module refactoring: putting some things in Servant.Common
This commit is contained in:
parent
1cd35034e9
commit
165022a554
17 changed files with 30 additions and 30 deletions
|
@ -22,7 +22,7 @@ import Servant.API
|
|||
import Servant.Client
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Common.BaseUrl
|
||||
|
||||
-- * Example
|
||||
|
||||
|
|
|
@ -26,13 +26,13 @@ library
|
|||
Servant.API.ReqBody
|
||||
Servant.API.Sub
|
||||
Servant.Client
|
||||
Servant.Common.BaseUrl
|
||||
Servant.Common.Req
|
||||
Servant.Common.Text
|
||||
Servant.Docs
|
||||
Servant.Server
|
||||
Servant.Utils.ApiQuasiQuoting
|
||||
Servant.Utils.BaseUrl
|
||||
Servant.Utils.Links
|
||||
Servant.Utils.Req
|
||||
Servant.Utils.Text
|
||||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, either
|
||||
|
|
|
@ -7,16 +7,16 @@ module Servant (
|
|||
module Servant.Server,
|
||||
-- | For accessing servant APIs as API clients.
|
||||
module Servant.Client,
|
||||
module Servant.Utils.BaseUrl,
|
||||
module Servant.Common.BaseUrl,
|
||||
-- | For generating documentation for servant APIs.
|
||||
module Servant.Docs,
|
||||
-- | Helper module
|
||||
module Servant.Utils.Text,
|
||||
module Servant.Common.Text,
|
||||
) where
|
||||
|
||||
import Servant.API
|
||||
import Servant.Client
|
||||
import Servant.Common.BaseUrl
|
||||
import Servant.Common.Text
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Utils.Text
|
||||
|
|
|
@ -12,10 +12,10 @@ import GHC.TypeLits
|
|||
import Network.Wai
|
||||
import Servant.API.Sub
|
||||
import Servant.Client
|
||||
import Servant.Common.Req
|
||||
import Servant.Common.Text
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.Req
|
||||
import Servant.Utils.Text
|
||||
|
||||
-- * Captures
|
||||
data Capture sym a
|
||||
|
|
|
@ -11,10 +11,10 @@ import Data.Typeable
|
|||
import Network.HTTP.Types
|
||||
import Network.Wai
|
||||
import Servant.Client
|
||||
import Servant.Common.BaseUrl
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- | Endpoint for DELETE requests.
|
||||
data Delete
|
||||
|
|
|
@ -12,10 +12,10 @@ import Data.Typeable
|
|||
import Network.HTTP.Types
|
||||
import Network.Wai
|
||||
import Servant.Client
|
||||
import Servant.Common.BaseUrl
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- | Endpoint for simple GET requests. The server doesn't receive any arguments
|
||||
-- and serves the contained type as JSON.
|
||||
|
|
|
@ -12,10 +12,10 @@ import Data.Typeable
|
|||
import Network.HTTP.Types
|
||||
import Network.Wai
|
||||
import Servant.Client
|
||||
import Servant.Common.BaseUrl
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- | Endpoint for POST requests. The type variable represents the type of the
|
||||
-- response body (not the request body, use 'Servant.API.RQBody.RQBody' for
|
||||
|
|
|
@ -12,10 +12,10 @@ import Data.Typeable
|
|||
import Network.HTTP.Types
|
||||
import Network.Wai
|
||||
import Servant.Client
|
||||
import Servant.Common.BaseUrl
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- | Endpoint for PUT requests.
|
||||
data Put a
|
||||
|
|
|
@ -16,10 +16,10 @@ import Network.HTTP.Types
|
|||
import Network.Wai
|
||||
import Servant.API.Sub
|
||||
import Servant.Client
|
||||
import Servant.Common.Req
|
||||
import Servant.Common.Text
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.Req
|
||||
import Servant.Utils.Text
|
||||
|
||||
-- * Single query string parameter lookup
|
||||
|
||||
|
|
|
@ -11,9 +11,9 @@ import Data.Proxy
|
|||
import Network.Wai
|
||||
import Servant.API.Sub
|
||||
import Servant.Client
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- * Request Body support
|
||||
data ReqBody a
|
||||
|
|
|
@ -9,9 +9,9 @@ import Data.String.Conversions
|
|||
import GHC.TypeLits
|
||||
import Network.Wai
|
||||
import Servant.Client
|
||||
import Servant.Common.Req
|
||||
import Servant.Docs
|
||||
import Servant.Server
|
||||
import Servant.Utils.Req
|
||||
|
||||
-- | The contained API (second argument) can be found under @("/" ++ path)@
|
||||
-- (path being the first argument).
|
||||
|
|
|
@ -4,7 +4,7 @@ module Servant.Client where
|
|||
|
||||
import Data.Proxy
|
||||
|
||||
import Servant.Utils.Req
|
||||
import Servant.Common.Req
|
||||
|
||||
-- * Accessing APIs as a Client
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
module Servant.Utils.BaseUrl where
|
||||
module Servant.Common.BaseUrl where
|
||||
|
||||
import Data.List
|
||||
import GHC.Generics
|
|
@ -1,6 +1,6 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
module Servant.Utils.Req where
|
||||
module Servant.Common.Req where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Concurrent
|
||||
|
@ -19,7 +19,7 @@ import Data.Text
|
|||
import Network.HTTP.Client
|
||||
import Network.HTTP.Types
|
||||
import Network.URI
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Common.BaseUrl
|
||||
import System.IO.Unsafe
|
||||
|
||||
import qualified Network.HTTP.Client as Client
|
|
@ -1,7 +1,7 @@
|
|||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TypeSynonymInstances #-}
|
||||
module Servant.Utils.Text where
|
||||
module Servant.Common.Text where
|
||||
|
||||
import Data.String.Conversions
|
||||
import Data.Int
|
|
@ -22,7 +22,7 @@ import Test.QuickCheck
|
|||
import Servant.API
|
||||
import Servant.Client
|
||||
import Servant.Server
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Common.BaseUrl
|
||||
|
||||
import Servant.ServerSpec
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
module Servant.Client.BaseUrlSpec where
|
||||
module Servant.Common.BaseUrlSpec where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.DeepSeq
|
||||
import Test.Hspec
|
||||
import Test.QuickCheck
|
||||
|
||||
import Servant.Utils.BaseUrl
|
||||
import Servant.Common.BaseUrl
|
||||
|
||||
spec :: Spec
|
||||
spec = do
|
Loading…
Reference in a new issue