testcontainers-0.4.0.0: Docker containers for your integration tests.
Safe HaskellSafe-Inferred
LanguageHaskell2010

TestContainers.Docker.Internal

Synopsis

Documentation

data DockerException Source #

Failing to interact with Docker results in this exception being thrown.

Since: 0.1.0.0

Constructors

DockerException 

Fields

InspectUnknownContainerId 

Fields

  • id :: ContainerId

    Id of the Container that we tried to lookup the port mapping.

InspectOutputInvalidJSON 

Fields

  • id :: ContainerId

    Id of the Container that we tried to lookup the port mapping.

InspectOutputMissingNetwork 

Fields

  • id :: ContainerId

    Id of the Container that we tried to lookup the port mapping.

InspectOutputUnexpected 

Fields

  • id :: ContainerId

    Id of the Container that we tried to lookup the port mapping.

UnknownPortMapping 

Fields

  • id :: ContainerId

    Id of the Container that we tried to lookup the port mapping.

  • port :: Text

    Textual representation of port mapping we were trying to look up.

Container related stuff

type ContainerId = Text Source #

Identifies a container within the Docker runtime. Assigned by docker run.

Since: 0.1.0.0

type InspectOutput = Value Source #

The parsed JSON output of docker inspect command.

Since: 0.1.0.0

Network related stuff

type NetworkId = Text Source #

Identifies a network within the Docker runtime. Assigned by docker network create

Since: 0.4.0.0

Running docker

docker :: MonadIO m => Tracer -> [Text] -> m String Source #

Internal function that runs Docker. Takes care of throwing an exception in case of failure.

Since: 0.1.0.0

dockerWithStdin :: MonadIO m => Tracer -> [Text] -> Text -> m String Source #

Internal function that runs Docker. Takes care of throwing an exception in case of failure.

Since: 0.1.0.0

Following logs

data Pipe Source #

A data type indicating which pipe to scan for a specific log line.

Since: 0.1.0.0

Constructors

Stdout

Refer to logs on STDOUT.

Stderr

Refer to logs on STDERR.

Instances

Instances details
Show Pipe Source # 
Instance details

Defined in TestContainers.Docker.Internal

Methods

showsPrec :: Int -> Pipe -> ShowS #

show :: Pipe -> String #

showList :: [Pipe] -> ShowS #

Eq Pipe Source # 
Instance details

Defined in TestContainers.Docker.Internal

Methods

(==) :: Pipe -> Pipe -> Bool #

(/=) :: Pipe -> Pipe -> Bool #

Ord Pipe Source # 
Instance details

Defined in TestContainers.Docker.Internal

Methods

compare :: Pipe -> Pipe -> Ordering #

(<) :: Pipe -> Pipe -> Bool #

(<=) :: Pipe -> Pipe -> Bool #

(>) :: Pipe -> Pipe -> Bool #

(>=) :: Pipe -> Pipe -> Bool #

max :: Pipe -> Pipe -> Pipe #

min :: Pipe -> Pipe -> Pipe #

type LogConsumer = Pipe -> ByteString -> IO () Source #

An abstraction for forwarding logs.

Since: 0.4.0.0

consoleLogConsumer :: LogConsumer Source #

A simple LogConsumer that writes log lines to stdout and stderr respectively.

Since: 0.4.0.0

dockerFollowLogs :: MonadResource m => Tracer -> ContainerId -> LogConsumer -> m () Source #

Forwards container logs to a LogConsumer. This is equivalent of calling docker logs containerId --follow

Since: 0.4.0.0