Documentation ¶
Index ¶
- func MapToEnv(data map[string]string) []string
- func Namespace(ss []string) string
- type BuildResponse
- type Container
- func (c *Container) Build(path string) (tag string, err error)
- func (c *Container) CreateNetwork(namespace []string) (id string, err error)
- func (c *Container) DeleteNetwork(namespace []string) error
- func (c *Container) FindContainer(namespace []string) (types.ContainerJSON, error)
- func (c *Container) FindNetwork(namespace []string) (types.NetworkResource, error)
- func (c *Container) FindService(namespace []string) (swarm.Service, error)
- func (c *Container) ListServices(label string) ([]swarm.Service, error)
- func (c *Container) ListTasks(namespace []string) ([]swarm.Task, error)
- func (c *Container) ServiceLogs(namespace []string) (io.ReadCloser, error)
- func (c *Container) ServiceStatus(namespace []string) (StatusType, error)
- func (c *Container) SharedNetworkID() (networkID string, err error)
- func (c *Container) StartService(options ServiceOptions) (serviceID string, err error)
- func (c *Container) Status(namespace []string) (StatusType, error)
- func (c *Container) StopService(namespace []string) (err error)
- func (c *Container) TasksError(namespace []string) ([]string, error)
- type Mount
- type Option
- type Port
- type ServiceOptions
- type StatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildResponse ¶
BuildResponse is the object that is returned by the docker api in json
type Container ¶ added in v0.2.0
type Container struct {
// contains filtered or unexported fields
}
Container provides high level interactions with Docker API for MESG.
func (*Container) CreateNetwork ¶ added in v0.2.0
CreateNetwork creates a Docker Network with a namespace.
func (*Container) DeleteNetwork ¶ added in v0.2.0
DeleteNetwork deletes a Docker Network associated with a namespace.
func (*Container) FindContainer ¶ added in v0.2.0
func (c *Container) FindContainer(namespace []string) (types.ContainerJSON, error)
FindContainer returns a docker container.
func (*Container) FindNetwork ¶ added in v0.2.0
func (c *Container) FindNetwork(namespace []string) (types.NetworkResource, error)
FindNetwork finds a Docker Network by a namespace. If no network is found, an error is returned.
func (*Container) FindService ¶ added in v0.2.0
FindService returns the Docker Service or an error if not found.
func (*Container) ListServices ¶ added in v0.2.0
ListServices returns existing docker services matching a specific label name.
func (*Container) ServiceLogs ¶ added in v0.2.0
func (c *Container) ServiceLogs(namespace []string) (io.ReadCloser, error)
ServiceLogs returns the logs of a service.
func (*Container) ServiceStatus ¶ added in v0.2.0
func (c *Container) ServiceStatus(namespace []string) (StatusType, error)
ServiceStatus returns the status of the Docker Swarm Servicer.
func (*Container) SharedNetworkID ¶ added in v0.2.0
SharedNetworkID returns the ID of the shared network.
func (*Container) StartService ¶ added in v0.2.0
func (c *Container) StartService(options ServiceOptions) (serviceID string, err error)
StartService starts a docker service.
func (*Container) Status ¶ added in v0.2.0
func (c *Container) Status(namespace []string) (StatusType, error)
Status returns the status of a docker container.
func (*Container) StopService ¶ added in v0.2.0
StopService stops a docker service.
type Option ¶ added in v0.2.0
type Option func(*Container)
Option is a configuration func for Container.
func ClientOption ¶ added in v0.2.0
func ClientOption(client docker.CommonAPIClient) Option
ClientOption receives a client which will be used to interact with Docker API.
func TimeoutOption ¶ added in v0.2.0
TimeoutOption receives d which will be set as a timeout value for Docker API calls.
type ServiceOptions ¶
type ServiceOptions struct { Image string Namespace []string Ports []Port Mounts []Mount Env []string // TODO: should be transform to map[string]string and use the func mapToEnv Args []string NetworksID []string Labels map[string]string }
ServiceOptions is a simplify version of swarm.ServiceSpec.
type StatusType ¶
type StatusType uint
StatusType of the service.
const ( STOPPED StatusType = 0 RUNNING StatusType = 1 )
Possible status for services.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dockertest provides functionalities for mocking and faking the Docker API.
|
Package dockertest provides functionalities for mocking and faking the Docker API. |