tmp-proc-rabbitmq-0.6.0.1: Launch RabbitMQ in docker using tmp-proc
Copyright(c) 2020-2021 Tim Emiola
LicenseBSD3
MaintainerTim Emiola <adetokunbo@users.noreply.github.com >
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.TmpProc.Docker.RabbitMQ

Description

Provides an instance of Proc that launches RabbitMQ as a tmp proc.

The instance this module provides can be used in integration tests as is.

It's also possible to write other instances that launch RabbitMQ in different ways; for those, this instance can be used as a reference example.

Synopsis

Proc instance

data TmpRabbitMQ Source #

Provides the capability to launch a RabbitMQ instance as a tmp proc.

Constructors

TmpRabbitMQ 

Instances

Instances details
Connectable TmpRabbitMQ Source #

Specifies how to connect to a tmp RabbitMQ service.

Instance details

Defined in System.TmpProc.Docker.RabbitMQ

Associated Types

type Conn TmpRabbitMQ = (conn :: Type) #

Proc TmpRabbitMQ Source #

Specifies how to run RabbitMQ as a tmp proc.

Instance details

Defined in System.TmpProc.Docker.RabbitMQ

Associated Types

type Image TmpRabbitMQ :: Symbol #

type Name TmpRabbitMQ = (labelName :: Symbol) #

type Conn TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

type Image TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

type Image TmpRabbitMQ = "rabbitmq:3.9"
type Name TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

type Name TmpRabbitMQ = "a-rabbitmq-server"

Useful definitions

aProc :: HList '[TmpRabbitMQ] Source #

A singleton HList containing a TmpRabbitMQ.

aHandle :: IO (HandlesOf '[TmpRabbitMQ]) Source #

An HList that just contains the handle created by aProc.

Re-exports

class (KnownSymbol (Image a), KnownSymbol (Name a)) => Proc a where #

Specifies how to launch a temporary process using Docker.

Minimal complete definition

uriOf, reset, ping

Associated Types

type Image a :: Symbol #

The image name of the docker image, e.g, postgres:10.6

type Name a = (labelName :: Symbol) | labelName -> a #

A label used to refer to running process created from this image, e.g, a-postgres-db

Methods

runArgs :: [Text] #

Additional arguments to the docker command that launches the tmp proc.

uriOf :: HostIpAddress -> SvcURI #

Determines the service URI of the process, when applicable.

reset :: ProcHandle a -> IO () #

Resets some state in a tmp proc service.

ping :: ProcHandle a -> IO Pinged #

Checks if the tmp proc started ok.

pingCount :: Natural #

Maximum number of pings to perform during startup.

pingGap :: Natural #

Number of milliseconds between pings.

Instances

Instances details
Proc TmpRabbitMQ Source #

Specifies how to run RabbitMQ as a tmp proc.

Instance details

Defined in System.TmpProc.Docker.RabbitMQ

Associated Types

type Image TmpRabbitMQ :: Symbol #

type Name TmpRabbitMQ = (labelName :: Symbol) #

type family Name a = (labelName :: Symbol) | labelName -> a #

A label used to refer to running process created from this image, e.g, a-postgres-db

Instances

Instances details
type Name TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

type Name TmpRabbitMQ = "a-rabbitmq-server"

data HList (a :: [Type]) where #

Defines a Heterogenous list.

Constructors

HNil :: HList ('[] :: [Type]) 
HCons :: forall anyTy (manyTys :: [Type]). anyTy -> HList manyTys -> HList (anyTy ': manyTys) infixr 5 

Instances

Instances details
(Show x, Show (HList xs)) => Show (HList (x ': xs)) 
Instance details

Defined in System.TmpProc.TypeLevel

Methods

showsPrec :: Int -> HList (x ': xs) -> ShowS #

show :: HList (x ': xs) -> String #

showList :: [HList (x ': xs)] -> ShowS #

Show (HList ('[] :: [Type])) 
Instance details

Defined in System.TmpProc.TypeLevel

Methods

showsPrec :: Int -> HList '[] -> ShowS #

show :: HList '[] -> String #

showList :: [HList '[]] -> ShowS #

(Eq x, Eq (HList xs)) => Eq (HList (x ': xs)) 
Instance details

Defined in System.TmpProc.TypeLevel

Methods

(==) :: HList (x ': xs) -> HList (x ': xs) -> Bool #

(/=) :: HList (x ': xs) -> HList (x ': xs) -> Bool #

Eq (HList ('[] :: [Type])) 
Instance details

Defined in System.TmpProc.TypeLevel

Methods

(==) :: HList '[] -> HList '[] -> Bool #

(/=) :: HList '[] -> HList '[] -> Bool #

type HandlesOf (procs :: [Type]) = HList (Proc2Handle procs) #

A list of ProcHandle values.

type SvcURI = ByteString #

A connection string used to access the service once its running.

type HostIpAddress = Text #

The IP address of the docker host.

type family Image a :: Symbol #

The image name of the docker image, e.g, postgres:10.6

Instances

Instances details
type Image TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

type Image TmpRabbitMQ = "rabbitmq:3.9"

class Proc a => Connectable a where #

Specifies how to a get a connection to a Proc.

Minimal complete definition

openConn

Associated Types

type Conn a = (conn :: Type) | conn -> a #

The connection type.

Methods

openConn :: ProcHandle a -> IO (Conn a) #

Get a connection to the Proc via its ProcHandle.

closeConn :: Conn a -> IO () #

Close a connection to a Proc.

Instances

Instances details
Connectable TmpRabbitMQ Source #

Specifies how to connect to a tmp RabbitMQ service.

Instance details

Defined in System.TmpProc.Docker.RabbitMQ

Associated Types

type Conn TmpRabbitMQ = (conn :: Type) #

type family Conn a = (conn :: Type) | conn -> a #

The connection type.

Instances

Instances details
type Conn TmpRabbitMQ Source # 
Instance details

Defined in System.TmpProc.Docker.RabbitMQ

data ProcHandle a #

Provides access to a Proc that has been started.

Constructors

ProcHandle 

Fields

only :: x -> HList '[x] #

Construct a singleton HList

startupAll :: forall (procs :: [Type]). AreProcs procs => HList procs -> IO (HandlesOf procs) #

Start up processes for each Proc type.

toPinged :: Exception e => Proxy e -> IO a -> IO Pinged #

Use an action that might throw an exception as a ping.

withTmpConn :: Connectable a => ProcHandle a -> (Conn a -> IO b) -> IO b #

Run an action on a Connectable handle as a callback on its Conn