Documentation
¶
Index ¶
- func DockerIP() (string, error)
- func NewHostConfig(pb *PortBindings) (*dockerContainer.HostConfig, error)
- func RandomPortTCP() (uint16, error)
- type Application
- type Binding
- type Container
- type ContainerID
- type Environment
- func (e Environment) BoolVar(name string, value bool) Environment
- func (e Environment) Int16Var(name string, value int16) Environment
- func (e Environment) Int32Var(name string, value int32) Environment
- func (e Environment) Int64Var(name string, value int64) Environment
- func (e Environment) Int8Var(name string, value int8) Environment
- func (e Environment) IntVar(name string, value int) Environment
- func (e Environment) LogLevelVar(name string, l log.Level) Environment
- func (e Environment) StringVar(name, value string) Environment
- func (e Environment) Uint16Var(name string, value uint16) Environment
- func (e Environment) Uint32Var(name string, value uint32) Environment
- func (e Environment) Uint64Var(name string, value uint64) Environment
- func (e Environment) Uint8Var(name string, value uint8) Environment
- func (e Environment) UintVar(name string, value uint) Environment
- type Group
- type Hook
- type HookType
- type HostConfigSpec
- type HostPort
- type Matcher
- type NetworkID
- type PortBindings
- type Protocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHostConfig ¶
func NewHostConfig(pb *PortBindings) (*dockerContainer.HostConfig, error)
NewHostConfig creates new HostConfig instance
func RandomPortTCP ¶
RandomPortTCP makes a query to the kernel about free high range IP address NOTE: it have some probability impact so could fail in the really small amount of cases
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(c Container, hooks ...Hook) *Application
type Container ¶
type Container interface { AwaitOutput(ctx context.Context, m Matcher) error Close(ctx context.Context) error Name() string NetworkAttach(networkID string) error Ping(ctx context.Context) error Run(ctx context.Context) error URL(proto Protocol, port uint16) (*HostPort, error) }
Container exposes interface to control the container runtime
func NewContainer ¶
func NewContainer(name, image string, cmd []string, environment Environment, ports *PortBindings) (Container, error)
New creates new container instance from remote docker image
func NewContainerWithClient ¶
func NewContainerWithClient(cli *client.Client, name, image string, cmd []string, env Environment, ports *PortBindings) (Container, error)
NewContainerWithClient creates new container from remote docker image and allows to pass custom docker.Client instance
type ContainerID ¶
type ContainerID = string
type Environment ¶
Environment represents the container environment passed into runtime
func NewEnvironment ¶
func NewEnvironment() Environment
NewEnvironment creates new Environment instance
func (Environment) BoolVar ¶
func (e Environment) BoolVar(name string, value bool) Environment
BoolVar sets bool var to the environment
func (Environment) Int16Var ¶
func (e Environment) Int16Var(name string, value int16) Environment
Int16Var sets int16 var to the environment
func (Environment) Int32Var ¶
func (e Environment) Int32Var(name string, value int32) Environment
Int32Var sets int32 var to the environment
func (Environment) Int64Var ¶
func (e Environment) Int64Var(name string, value int64) Environment
Int64Var sets int64 var to the envorinment
func (Environment) Int8Var ¶
func (e Environment) Int8Var(name string, value int8) Environment
Int8Var sets int8 var to the environment
func (Environment) IntVar ¶
func (e Environment) IntVar(name string, value int) Environment
IntVar sets int var to the environment
func (Environment) LogLevelVar ¶
func (e Environment) LogLevelVar(name string, l log.Level) Environment
LogLevelVar sets logrus.Level var to the environment
func (Environment) StringVar ¶
func (e Environment) StringVar(name, value string) Environment
StringVar sets string var to the environment
func (Environment) Uint16Var ¶
func (e Environment) Uint16Var(name string, value uint16) Environment
Uint16Var sets uint16 var to the environment
func (Environment) Uint32Var ¶
func (e Environment) Uint32Var(name string, value uint32) Environment
Uint32Var sets uint32 var to the environment
func (Environment) Uint64Var ¶
func (e Environment) Uint64Var(name string, value uint64) Environment
Uint64Var sets uint64 var to the environment
func (Environment) Uint8Var ¶
func (e Environment) Uint8Var(name string, value uint8) Environment
Uint8Var sets uint8 var to the environment
func (Environment) UintVar ¶
func (e Environment) UintVar(name string, value uint) Environment
UintVar sets uint var to the environent
type Group ¶
func NewGroupWithClient ¶
type HostConfigSpec ¶
HostConfigSpec is just a wrapper structure to pass host configuration to the container
type Matcher ¶
Matcher allows to create any kind of matcher for container outputs
func NewExactMatcher ¶
NewExactMatcher represents exact matcher i.e. the output should be exactly matched (except space chars around the word)
func NewRegexpMatcher ¶
func NewSubstringMatcher ¶
NewSubstringMatcher represents partial matcher
type PortBindings ¶
type PortBindings struct {
// contains filtered or unexported fields
}
PortBindings is a full mapping of internal & external docker container ports
func NewPortBindings ¶
func NewPortBindings() *PortBindings
NewPortBindings creates new PortBindings instance
func NewPortBindingsWithTCPPortAllocator ¶
func NewPortBindingsWithTCPPortAllocator(allocator func() (uint16, error)) *PortBindings
NewPortBindingsWithTCPPortAllocator creates new PortBinding instance and allows to pass custom port allocation function
func (*PortBindings) PortDNAT ¶
func (pb *PortBindings) PortDNAT(proto Protocol, port uint16) *PortBindings
PortDNAT adds new port to be exposed from the container