git.iko.soy/typeable/bloodhound
on master help sign in
slams large red button on desk, 'that was easy'
956a2c4Chris Allen
Database/Bloodhound/Client.hs+3−3
@@ -22,7 +22,7 @@ import Data.ByteString.Builder
22import Data.List (foldl', intercalate, intersperse)
22import Data.List (foldl', intercalate, intersperse)
23import Data.Maybe (fromMaybe)
23import Data.Maybe (fromMaybe)
24import Data.Text (Text)
24import Data.Text (Text)
25−import Network.HTTP.Conduit
25+import Network.HTTP.Client
26import qualified Network.HTTP.Types.Method as NHTM
26import qualified Network.HTTP.Types.Method as NHTM
27import qualified Network.HTTP.Types.Status as NHTS
27import qualified Network.HTTP.Types.Status as NHTS
28import Prelude hiding (head, filter)
28import Prelude hiding (head, filter)
@@ -61,7 +61,7 @@ dispatch dMethod url body = do
61 let req = initReq { method = dMethod
61 let req = initReq { method = dMethod
62 , requestBody = reqBody
62 , requestBody = reqBody
63 , checkStatus = \_ _ _ -> Nothing}
63 , checkStatus = \_ _ _ -> Nothing}
64− withManager $ httpLbs req
64+ withManager defaultManagerSettings $ httpLbs req
65
65
66joinPath :: [String] -> String
66joinPath :: [String] -> String
67joinPath = intercalate "/"
67joinPath = intercalate "/"
@@ -85,7 +85,7 @@ post = dispatch NHTM.methodPost
85getStatus :: Server -> IO (Maybe Status)
85getStatus :: Server -> IO (Maybe Status)
86getStatus (Server server) = do
86getStatus (Server server) = do
87 request <- parseUrl $ joinPath [server]
87 request <- parseUrl $ joinPath [server]
88− response <- withManager $ httpLbs request
88+ response <- withManager defaultManagerSettings $ httpLbs request
89 return $ decode (responseBody response)
89 return $ decode (responseBody response)
90
90
91createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
91createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
Database/Bloodhound/Types.hs+2−2
@@ -131,7 +131,7 @@ import qualified Data.Text as T
131import Data.Time.Clock (UTCTime)
131import Data.Time.Clock (UTCTime)
132import Database.Bloodhound.Types.Class
132import Database.Bloodhound.Types.Class
133import GHC.Generics (Generic)
133import GHC.Generics (Generic)
134−import Network.HTTP.Conduit
134+import Network.HTTP.Client
135import qualified Network.HTTP.Types.Method as NHTM
135import qualified Network.HTTP.Types.Method as NHTM
136
136
137
137
@@ -169,7 +169,7 @@ defaultIndexSettings :: IndexSettings
169defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
169defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
170
170
171{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method' -}
171{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method' -}
172−type Reply = Network.HTTP.Conduit.Response L.ByteString
172+type Reply = Network.HTTP.Client.Response L.ByteString
173type Method = NHTM.Method
173type Method = NHTM.Method
174
174
175{-| 'OpenCloseIndex' is a sum type for opening and closing indices.
175{-| 'OpenCloseIndex' is a sum type for opening and closing indices.
bloodhound.cabal+3−2
@@ -28,7 +28,8 @@ library
28 bytestring >= 0.10.2,
28 bytestring >= 0.10.2,
29 aeson >= 0.7,
29 aeson >= 0.7,
30 conduit >= 1.0,
30 conduit >= 1.0,
31− http-conduit >= 2.0,
31+ -- http-conduit >= 2.0,
32+ http-client >= 0.3,
32 time >= 1.4,
33 time >= 1.4,
33 text >= 0.11,
34 text >= 0.11,
34 http-types >= 0.8
35 http-types >= 0.8
@@ -42,7 +43,7 @@ test-suite tests
42 hs-source-dirs: tests
43 hs-source-dirs: tests
43 build-depends: base,
44 build-depends: base,
44 bloodhound,
45 bloodhound,
45− http-conduit,
46+ http-client,
46 http-types,
47 http-types,
47 hspec >= 1.8,
48 hspec >= 1.8,
48 text >= 0.11,
49 text >= 0.11,
tests/tests.hs+1−1
@@ -8,7 +8,7 @@ import Data.Time.Calendar (Day(..))
8import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
8import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
9import Data.Text (Text)
9import Data.Text (Text)
10import GHC.Generics (Generic)
10import GHC.Generics (Generic)
11−import Network.HTTP.Conduit
11+import Network.HTTP.Client
12import qualified Network.HTTP.Types.Status as NHTS
12import qualified Network.HTTP.Types.Status as NHTS
13import Prelude hiding (filter, putStrLn)
13import Prelude hiding (filter, putStrLn)
14import Test.Hspec
14import Test.Hspec