git.iko.soy/typeable/bloodhound
on master help sign in
slams large red button on desk, 'that was easy'
commit956a2c43b85eb5a16a5ecc14337dc4d41f9543bf authorChris Allen <cma@bitemyapp.com> dateMon 19 May 2014, 12:59 (12 years ago) parentd03228d
4 files changed+9−8
Database/Bloodhound/Client.hs+3−3 Database/Bloodhound/Types.hs+2−2 bloodhound.cabal+3−2 tests/tests.hs+1−1
Database/Bloodhound/Client.hs+3−3
@@ -22,7 +22,7 @@ import Data.ByteString.Builder
2222import Data.List (foldl', intercalate, intersperse)
2323import Data.Maybe (fromMaybe)
2424import Data.Text (Text)
25−import Network.HTTP.Conduit
25+import Network.HTTP.Client
2626import qualified Network.HTTP.Types.Method as NHTM
2727import qualified Network.HTTP.Types.Status as NHTS
2828import Prelude hiding (head, filter)
@@ -61,7 +61,7 @@ dispatch dMethod url body = do
6161 let req = initReq { method = dMethod
6262 , requestBody = reqBody
6363 , checkStatus = \_ _ _ -> Nothing}
64− withManager $ httpLbs req
64+ withManager defaultManagerSettings $ httpLbs req
6565
6666joinPath :: [String] -> String
6767joinPath = intercalate "/"
@@ -85,7 +85,7 @@ post = dispatch NHTM.methodPost
8585getStatus :: Server -> IO (Maybe Status)
8686getStatus (Server server) = do
8787 request <- parseUrl $ joinPath [server]
88− response <- withManager $ httpLbs request
88+ response <- withManager defaultManagerSettings $ httpLbs request
8989 return $ decode (responseBody response)
9090
9191createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
Database/Bloodhound/Types.hs+2−2
@@ -131,7 +131,7 @@ import qualified Data.Text as T
131131import Data.Time.Clock (UTCTime)
132132import Database.Bloodhound.Types.Class
133133import GHC.Generics (Generic)
134−import Network.HTTP.Conduit
134+import Network.HTTP.Client
135135import qualified Network.HTTP.Types.Method as NHTM
136136
137137
@@ -169,7 +169,7 @@ defaultIndexSettings :: IndexSettings
169169defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
170170
171171{-| '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
173173type Method = NHTM.Method
174174
175175{-| 'OpenCloseIndex' is a sum type for opening and closing indices.
bloodhound.cabal+3−2
@@ -28,7 +28,8 @@ library
2828 bytestring >= 0.10.2,
2929 aeson >= 0.7,
3030 conduit >= 1.0,
31− http-conduit >= 2.0,
31+ -- http-conduit >= 2.0,
32+ http-client >= 0.3,
3233 time >= 1.4,
3334 text >= 0.11,
3435 http-types >= 0.8
@@ -42,7 +43,7 @@ test-suite tests
4243 hs-source-dirs: tests
4344 build-depends: base,
4445 bloodhound,
45− http-conduit,
46+ http-client,
4647 http-types,
4748 hspec >= 1.8,
4849 text >= 0.11,
tests/tests.hs+1−1
@@ -8,7 +8,7 @@ import Data.Time.Calendar (Day(..))
88import Data.Time.Clock (secondsToDiffTime, UTCTime(..))
99import Data.Text (Text)
1010import GHC.Generics (Generic)
11−import Network.HTTP.Conduit
11+import Network.HTTP.Client
1212import qualified Network.HTTP.Types.Status as NHTS
1313import Prelude hiding (filter, putStrLn)
1414import Test.Hspec