@@ -28,24 +28,24 @@ type Response = HTTP.Response BL.ByteString
29data Signal = SIGINT | SIGKILL deriving (Eq, Show)
29data Signal = SIGINT | SIGKILL deriving (Eq, Show)
31−data DockerClientOpts m = DockerClientOpts {
31+data DockerClientOpts = DockerClientOpts {
32− http :: Request -> m Response
33− , apiVer :: ApiVersion
32+ apiVer :: ApiVersion
34 , baseUrl :: URL
33 , baseUrl :: URL
37−type DockerT m a = ReaderT (DockerClientOpts m) (ExceptT String m) a
36+type HttpHandler m = Request -> m Response
38+type DockerT m a = ReaderT (DockerClientOpts, HttpHandler m) (ExceptT String m) a
39−runDockerT :: (Monad m) => DockerClientOpts m -> DockerT m a -> m (Either String a)
40+runDockerT :: (Monad m) => (DockerClientOpts, HttpHandler m) -> DockerT m a -> m (Either String a)
40runDockerT opts a = runExceptT $ runReaderT a opts
41runDockerT opts a = runExceptT $ runReaderT a opts
41-- runDockerT opts a = (runExceptT .) . flip runReaderT opts a
42-- runDockerT opts a = (runExceptT .) . flip runReaderT opts a
43data ListOpts = ListOpts { all :: Bool } deriving (Eq, Show)
44data ListOpts = ListOpts { all :: Bool } deriving (Eq, Show)
45−defaultClientOpts :: DockerClientOpts IO
46+defaultClientOpts :: DockerClientOpts
46defaultClientOpts = DockerClientOpts {
47defaultClientOpts = DockerClientOpts {
48− , apiVer = "v1.22"
48+ apiVer = "v1.22"
49 , baseUrl = "http://127.0.0.1:2375/"
49 , baseUrl = "http://127.0.0.1:2375/"