@@ -280,7 +280,7 @@ data ContainerRequest = ContainerRequest
280280
281281-- | Parameters for a naming a Docker container.
282282--
283- -- @since 0.4 .0.0
283+ -- @since 0.5 .0.0
284284data NamingStrategy
285285 = RandomName
286286 | FixedName Text
@@ -319,7 +319,7 @@ setName = setFixedName
319319-- | Set the name of a Docker container. This is equivalent to invoking @docker run@
320320-- with the @--name@ parameter.
321321--
322- -- @since 0.4 .0.0
322+ -- @since 0.5 .0.0
323323setFixedName :: Text -> ContainerRequest -> ContainerRequest
324324setFixedName newName req =
325325 -- TODO error on empty Text
@@ -328,7 +328,7 @@ setFixedName newName req =
328328-- | Set the name randomly given of a Docker container. This is equivalent to omitting
329329-- the @--name@ parameter calling @docker run@.
330330--
331- -- @since 0.4 .0.0
331+ -- @since 0.5 .0.0
332332setRandomName :: ContainerRequest -> ContainerRequest
333333setRandomName req =
334334 -- TODO error on empty Text
@@ -337,7 +337,7 @@ setRandomName req =
337337-- | Set the name randomly suffixed of a Docker container. This is equivalent to invoking
338338-- @docker run@ with the @--name@ parameter.
339339--
340- -- @since 0.4 .0.0
340+ -- @since 0.5 .0.0
341341setSuffixedName :: Text -> ContainerRequest -> ContainerRequest
342342setSuffixedName preffix req =
343343 -- TODO error on empty Text
@@ -376,22 +376,22 @@ setEnv newEnv req =
376376-- | Set the network the container will connect to. This is equivalent to passing
377377-- @--network network_name@ to @docker run@.
378378--
379- -- @since 0.4 .0.0
379+ -- @since 0.5 .0.0
380380withNetwork :: Network -> ContainerRequest -> ContainerRequest
381381withNetwork network req =
382382 req {network = Just (Left network)}
383383
384384-- | Set the network alias for this container. This is equivalent to passing
385385-- @--network-alias alias@ to @docker run@.
386386--
387- -- @since 0.4 .0.0
387+ -- @since 0.5 .0.0
388388withNetworkAlias :: Text -> ContainerRequest -> ContainerRequest
389389withNetworkAlias alias req =
390390 req {networkAlias = Just alias}
391391
392392-- | Sets labels for a container
393393--
394- -- @since 0.4 .0.0
394+ -- @since 0.5 .0.0
395395withLabels :: [(Text , Text )] -> ContainerRequest -> ContainerRequest
396396withLabels xs request =
397397 request {labels = xs}
@@ -406,7 +406,7 @@ setLink newLink req =
406406
407407-- | Forwards container logs to the given 'LogConsumer' once ran.
408408--
409- -- @since 0.4 .0.0
409+ -- @since 0.5 .0.0
410410withFollowLogs :: LogConsumer -> ContainerRequest -> ContainerRequest
411411withFollowLogs logConsumer request =
412412 request {followLogs = Just logConsumer}
@@ -434,14 +434,14 @@ data Port = Port
434434defaultProtocol :: Text
435435defaultProtocol = " tcp"
436436
437- -- @since 0.4 .0.0
437+ -- @since 0.5 .0.0
438438instance Show Port where
439439 show Port {port, protocol} =
440440 show port <> " /" <> unpack protocol
441441
442442-- | A cursed but handy instance supporting literal 'Port's.
443443--
444- -- @since 0.4 .0.0
444+ -- @since 0.5 .0.0
445445instance Num Port where
446446 fromInteger x =
447447 Port {port = fromIntegral x, protocol = defaultProtocol}
@@ -454,7 +454,7 @@ instance Num Port where
454454-- | A cursed but handy instance supporting literal 'Port's of them
455455-- form @"8080"@, @"8080/udp"@, @"8080/tcp"@.
456456--
457- -- @since 0.4 .0.0
457+ -- @since 0.5 .0.0
458458instance IsString Port where
459459 fromString input = case splitOn " /" (pack input) of
460460 [numberish]
@@ -586,7 +586,7 @@ run request = do
586586
587587-- | Sets up a Ryuk 'Reaper'.
588588--
589- -- @since 0.4 .0.0
589+ -- @since 0.5 .0.0
590590createRyukReaper :: TestContainer Reaper
591591createRyukReaper = do
592592 ryukContainer <-
@@ -768,11 +768,11 @@ data WaitUntilReady
768768 -- Next check
769769 WaitUntilReady
770770
771- -- | @since 0.4 .0.0
771+ -- | @since 0.5 .0.0
772772instance Semigroup WaitUntilReady where
773773 (<>) = WaitMany
774774
775- -- | @since 0.4 .0.0
775+ -- | @since 0.5 .0.0
776776instance Monoid WaitUntilReady where
777777 mempty = WaitReady mempty
778778
@@ -813,7 +813,7 @@ instance Exception InvalidStateException
813813-- | @waitForState@ waits for a certain state of the container. If the container reaches a terminal
814814-- state 'InvalidStateException' will be thrown.
815815--
816- -- @since 0.4 .0.0
816+ -- @since 0.5 .0.0
817817waitForState :: (State -> Bool ) -> WaitUntilReady
818818waitForState isReady = WaitReady $ \ Container {id } -> do
819819 let wait = do
@@ -841,7 +841,7 @@ waitForState isReady = WaitReady $ \Container {id} -> do
841841
842842-- | @successfulExit@ is supposed to be used in conjunction with 'waitForState'.
843843--
844- -- @since 0.4 .0.0
844+ -- @since 0.5 .0.0
845845successfulExit :: State -> Bool
846846successfulExit state =
847847 stateStatus state == Exited && stateExitCode state == Just 0
@@ -857,7 +857,7 @@ waitUntilTimeout = WaitUntilTimeout
857857-- | Waits for a specific http status code.
858858-- This combinator should always be used with `waitUntilTimeout`.
859859--
860- -- @since 0.4 .0.0
860+ -- @since 0.5 .0.0
861861waitForHttp ::
862862 -- | Port
863863 Port ->
@@ -1097,7 +1097,7 @@ internalContainerIp Container {id, inspectOutput} =
10971097-- | Get the container's network alias.
10981098-- Takes the first alias found.
10991099--
1100- -- @since 0.4 .0.0
1100+ -- @since 0.5 .0.0
11011101containerAlias :: Container -> Text
11021102containerAlias Container {id , inspectOutput} =
11031103 case inspectOutput
@@ -1120,7 +1120,7 @@ containerAlias Container {id, inspectOutput} =
11201120-- | Get the IP address for the container's gateway, i.e. the host.
11211121-- Takes the first gateway address found.
11221122--
1123- -- @since 0.4 .0.0
1123+ -- @since 0.5 .0.0
11241124containerGateway :: Container -> Text
11251125containerGateway Container {id , inspectOutput} =
11261126 case inspectOutput
@@ -1174,7 +1174,7 @@ containerPort Container {id, inspectOutput} Port {port, protocol} =
11741174-- domain and port if the program is running in the same network. Otherwise,
11751175-- 'containerAddress' will use the exposed port on the Docker host.
11761176--
1177- -- @since 0.4 .0.0
1177+ -- @since 0.5 .0.0
11781178containerAddress :: Container -> Port -> (Text , Int )
11791179containerAddress container Port {port, protocol} =
11801180 let inDocker = unsafePerformIO isRunningInDocker
0 commit comments