Documentation ¶
Index ¶
- type Container
- type DockerContainer
- func (c *DockerContainer) Build(path string) (tag string, err error)
- func (c *DockerContainer) Cleanup() error
- func (c *DockerContainer) CreateNetwork(namespace string) (string, error)
- func (c *DockerContainer) DeleteNetwork(namespace string) error
- func (c *DockerContainer) DeleteVolume(name string) error
- func (c *DockerContainer) SharedNetworkID() string
- func (c *DockerContainer) StartService(options ServiceOptions) (string, error)
- func (c *DockerContainer) StopService(namespace string) error
- type Mount
- type Network
- type Port
- type ServiceOptions
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶ added in v0.2.0
type Container interface { Build(path string) (tag string, err error) CreateNetwork(namespace string) (id string, err error) DeleteNetwork(namespace string) error StartService(options ServiceOptions) (serviceID string, err error) StopService(namespace string) (err error) DeleteVolume(name string) error }
Container describes the API of container package.
type DockerContainer ¶ added in v0.3.0
type DockerContainer struct {
// contains filtered or unexported fields
}
DockerContainer provides high level interactions with Docker API for MESG.
func New ¶ added in v0.2.0
func New(nsprefix string) (*DockerContainer, error)
New creates a new Container with given options.
func (*DockerContainer) Build ¶ added in v0.3.0
func (c *DockerContainer) Build(path string) (tag string, err error)
Build builds a docker image.
func (*DockerContainer) Cleanup ¶ added in v0.16.0
func (c *DockerContainer) Cleanup() error
Cleanup cleans all configuration like shared network of running services.
func (*DockerContainer) CreateNetwork ¶ added in v0.3.0
func (c *DockerContainer) CreateNetwork(namespace string) (string, error)
CreateNetwork creates a Docker Network with a namespace. Retruns network id and error.
func (*DockerContainer) DeleteNetwork ¶ added in v0.3.0
func (c *DockerContainer) DeleteNetwork(namespace string) error
DeleteNetwork deletes a Docker Network associated with a namespace.
func (*DockerContainer) DeleteVolume ¶ added in v0.5.0
func (c *DockerContainer) DeleteVolume(name string) error
DeleteVolume deletes a Docker Volume by name.
func (*DockerContainer) SharedNetworkID ¶ added in v0.3.0
func (c *DockerContainer) SharedNetworkID() string
SharedNetworkID returns the ID of the shared network.
func (*DockerContainer) StartService ¶ added in v0.3.0
func (c *DockerContainer) StartService(options ServiceOptions) (string, error)
StartService starts a docker service.
func (*DockerContainer) StopService ¶ added in v0.3.0
func (c *DockerContainer) StopService(namespace string) error
StopService stops a docker service.
type Network ¶ added in v0.4.0
type Network struct { // ID of the docker network. ID string // Alias is an optional attribute to name this service in the // network and be able to access to it using this name. Alias string }
Network keeps the network info for service.