Documentation ¶
Index ¶
- type DockerService
- type Network
- type Params
- type Service
- func (Service *Service) Clean() error
- func (Service *Service) Create() error
- func (Service *Service) DockerCreate() error
- func (Service *Service) DockerLogs() ([]byte, error)
- func (Service *Service) DockerRun() error
- func (Service *Service) DockerRunInteractive() error
- func (Service *Service) GetFieldBool(field string) (bool, error)
- func (Service *Service) GetFieldInt(field string) (int, error)
- func (Service *Service) GetFieldString(field string) (string, error)
- func (Service *Service) GetRunning() (types.Container, error)
- func (Service *Service) Remove() error
- func (Service *Service) SetField(name string, value interface{}) error
- func (Service *Service) Setup() error
- func (Service *Service) Start() error
- func (Service *Service) Status() (bool, error)
- func (Service *Service) Stop() error
- func (Service *Service) StopAndRemove() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerService ¶
DockerService is the requirements for a Docker container to be compatible. The Service struct is used to implement this interface, and individual variables of type Service can/have overwritten them when logic deems it necessary.
type Network ¶
type Network struct { // Name is the name of the network, it is independent of the map key which // will be used to configure pygmy but this field should match the map key. Name string `yaml:"name"` // Containers is a []string which indicates the names of the containers // that need to be connected to this network. Containers []string `yaml:"containers"` // Config is the actual Network configuration for the Docker Network. // It is the Network creation configuration as provided by the Docker API. Config networktypes.CreateOptions `yaml:"config"` }
Network is a struct containing the configuration of a single Docker network including some extra fields so that Pygmy knows how to interact with the desired outcome.
type Params ¶
type Params struct { // Domain is the target domain for Pygmy to use. Domain string }
Params is an arbitrary struct to pass around configuration from the top level to the lowest level - such as variable input to one of the containers.
type Service ¶
type Service struct { Config containertypes.Config HostConfig containertypes.HostConfig Image string `yaml:"image"` NetworkConfig networktypes.NetworkingConfig }
Service is a collection of requirements for starting a container and provides a way for config of any container to be overridden and start fully compatible with Docker's API.
func (*Service) Create ¶
Create will perform a series of checks to see if the container starting is supposed be removed before-hand and will check to see if the container is running before it is actually started.
func (*Service) DockerCreate ¶
DockerCreate will setup and run a given container.
func (*Service) DockerLogs ¶
DockerLogs will return the logs from the container.
func (*Service) DockerRunInteractive ¶ added in v0.12.0
DockerRunInteractive will start an interactive container.
func (*Service) GetFieldBool ¶
GetFieldBool will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a bool.
func (*Service) GetFieldInt ¶
GetFieldInt will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as an int.
func (*Service) GetFieldString ¶
GetFieldString will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a string.
func (*Service) GetRunning ¶
GetRunning will get a types.Container variable for a given running container and it will not retrieve any information on containers that are not running.
func (*Service) SetField ¶
SetField will set a pygmy label to be equal to the string equal of an interface{}, even if it already exists. It should not matter if this container is running or not.
func (*Service) Setup ¶
Setup will detect if the Service's image reference exists and will attempt to run `docker pull` on the non-canonical image if it is not found in the daemon.
func (*Service) Start ¶
Start will perform a series of checks to see if the container starting is supposed be removed before-hand and will check to see if the container is running before it is actually started.
func (*Service) StopAndRemove ¶ added in v0.10.0
StopAndRemove will stop and remove the container.