Documentation
¶
Index ¶
- type Params
- type Service
- func (Service *Service) Clean(ctx context.Context, cli *client.Client) error
- func (Service *Service) Create(ctx context.Context, cli *client.Client) error
- func (Service *Service) DockerCreate(ctx context.Context, cli *client.Client) error
- func (Service *Service) DockerLogs(ctx context.Context, cli *client.Client) ([]byte, error)
- func (Service *Service) DockerRun(ctx context.Context, cli *client.Client) error
- func (Service *Service) DockerRunInteractive(ctx context.Context, cli *client.Client) error
- func (Service *Service) GetFieldBool(ctx context.Context, cli *client.Client, field string) (bool, error)
- func (Service *Service) GetFieldInt(ctx context.Context, cli *client.Client, field string) (int, error)
- func (Service *Service) GetFieldString(ctx context.Context, cli *client.Client, field string) (string, error)
- func (Service *Service) ID(ctx context.Context, cli *client.Client) (string, error)
- func (Service *Service) Labels(ctx context.Context, cli *client.Client) (map[string]string, error)
- func (Service *Service) Remove(ctx context.Context, cli *client.Client) error
- func (Service *Service) SetField(ctx context.Context, cli *client.Client, name string, value interface{}) error
- func (Service *Service) Setup(ctx context.Context, cli *client.Client) error
- func (Service *Service) Start(ctx context.Context, cli *client.Client) error
- func (Service *Service) Status(ctx context.Context, cli *client.Client) (bool, error)
- func (Service *Service) Stop(ctx context.Context, cli *client.Client) error
- func (Service *Service) StopAndRemove(ctx context.Context, cli *client.Client) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 }
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 ¶
DockerRunInteractive will start an interactive container.
func (*Service) GetFieldBool ¶
func (Service *Service) GetFieldBool(ctx context.Context, cli *client.Client, field string) (bool, error)
GetFieldBool will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a bool.
func (*Service) GetFieldInt ¶
func (Service *Service) GetFieldInt(ctx context.Context, cli *client.Client, field string) (int, error)
GetFieldInt will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as an int.
func (*Service) GetFieldString ¶
func (Service *Service) GetFieldString(ctx context.Context, cli *client.Client, field string) (string, error)
GetFieldString will get and return a tag on the service using the pygmy convention ("pygmy.*") and return it as a string.
func (*Service) ID ¶
ID will get a types.Container variable for a given running container and it will not retrieve any information on containers that are not running. todo: digests instead of name?
func (*Service) Labels ¶
Labels 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 ¶
func (Service *Service) SetField(ctx context.Context, cli *client.Client, name string, value interface{}) error
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.