Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Request = Request
- type Response = Response ByteString
- type HttpVerb = StdMethod
- newtype HttpHandler m = HttpHandler (forall a. Request -> (Response () -> Sink ByteString m (Either DockerError a)) -> m (Either DockerError a))
- data DockerError
- newtype DockerT m a = DockerT {
- unDockerT :: Monad m => ReaderT (DockerClientOpts, HttpHandler m) m a
- runDockerT :: Monad m => (DockerClientOpts, HttpHandler m) -> DockerT m a -> m a
- mkHttpRequest :: HttpVerb -> Endpoint -> DockerClientOpts -> Maybe Request
- defaultHttpHandler :: (MonadUnliftIO m, MonadIO m, MonadMask m) => m (HttpHandler m)
- httpHandler :: (MonadUnliftIO m, MonadIO m, MonadMask m) => Manager -> HttpHandler m
- unixHttpHandler :: (MonadUnliftIO m, MonadIO m, MonadMask m) => FilePath -> m (HttpHandler m)
- clientParamsWithClientAuthentication :: HostName -> PortNumber -> FilePath -> FilePath -> IO (Either String ClientParams)
- clientParamsSetCA :: ClientParams -> FilePath -> IO ClientParams
- statusCodeToError :: Endpoint -> Status -> Maybe DockerError
Documentation
type Response = Response ByteString Source #
newtype HttpHandler m Source #
HttpHandler (forall a. Request -> (Response () -> Sink ByteString m (Either DockerError a)) -> m (Either DockerError a)) |
Instances
Monad m => MonadReader (DockerClientOpts, HttpHandler m) (DockerT m) Source # | |
Defined in Docker.Client.Http ask :: DockerT m (DockerClientOpts, HttpHandler m) # local :: ((DockerClientOpts, HttpHandler m) -> (DockerClientOpts, HttpHandler m)) -> DockerT m a -> DockerT m a # reader :: ((DockerClientOpts, HttpHandler m) -> a) -> DockerT m a # |
data DockerError Source #
DockerConnectionError HttpException | |
DockerInvalidRequest Endpoint | |
DockerClientError Text | |
DockerClientDecodeError Text | Could not parse the response from the Docker endpoint. |
DockerInvalidStatusCode Status | Invalid exit code received from Docker endpoint. |
GenericDockerError Text |
Instances
Show DockerError Source # | |
Defined in Docker.Client.Http showsPrec :: Int -> DockerError -> ShowS # show :: DockerError -> String # showList :: [DockerError] -> ShowS # |
DockerT | |
|
Instances
MonadTrans DockerT Source # | |
Defined in Docker.Client.Http | |
Monad m => Monad (DockerT m) Source # | |
Functor m => Functor (DockerT m) Source # | |
Applicative m => Applicative (DockerT m) Source # | |
MonadIO m => MonadIO (DockerT m) Source # | |
Defined in Docker.Client.Http | |
Monad m => MonadReader (DockerClientOpts, HttpHandler m) (DockerT m) Source # | |
Defined in Docker.Client.Http ask :: DockerT m (DockerClientOpts, HttpHandler m) # local :: ((DockerClientOpts, HttpHandler m) -> (DockerClientOpts, HttpHandler m)) -> DockerT m a -> DockerT m a # reader :: ((DockerClientOpts, HttpHandler m) -> a) -> DockerT m a # |
runDockerT :: Monad m => (DockerClientOpts, HttpHandler m) -> DockerT m a -> m a Source #
mkHttpRequest :: HttpVerb -> Endpoint -> DockerClientOpts -> Maybe Request Source #
defaultHttpHandler :: (MonadUnliftIO m, MonadIO m, MonadMask m) => m (HttpHandler m) Source #
httpHandler :: (MonadUnliftIO m, MonadIO m, MonadMask m) => Manager -> HttpHandler m Source #
:: (MonadUnliftIO m, MonadIO m, MonadMask m) | |
=> FilePath | The socket to connect to |
-> m (HttpHandler m) |
Connect to a unix domain socket (the default docker socket is at /var/run/docker.sock)
Docker seems to ignore the hostname in requests sent over unix domain sockets (and the port obviously doesn't matter either)
clientParamsWithClientAuthentication :: HostName -> PortNumber -> FilePath -> FilePath -> IO (Either String ClientParams) Source #
clientParamsSetCA :: ClientParams -> FilePath -> IO ClientParams Source #
statusCodeToError :: Endpoint -> Status -> Maybe DockerError Source #