container

package
v0.0.0-...-c7d11c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContainerShellSession

func NewContainerShellSession(ctr *Container) *shellsession.ShellSession

Types

type AppliedAction

type AppliedAction string
const (
	Run     AppliedAction = "run"
	Start   AppliedAction = "start"
	Stop    AppliedAction = "stop"
	Kill    AppliedAction = "kill"
	Restart AppliedAction = "restart"
	Remove  AppliedAction = "remove"
)

type BlueGreenMode

type BlueGreenMode int
const (
	BGModeOff BlueGreenMode = iota
	BGModeOn
	BGModeUnknown
)

type Container

type Container struct {
	// Container name
	Name string
	// name of service (not including number)
	ServiceName string
	// non unique service id, eg the first col in config, "mongo" or "php"
	ServiceType string
	// the order defined in the config output
	Placement int
	// arguments to container
	ContainerArgs []string
	// image to use
	Image string
	// if supplied will do docker build on this path
	Build string
	// The arguments for the build command
	BuildArgs []string
	// command for container
	Command []string
	// links
	Links []Link
	// volumes from list
	VolumesFrom []string
	// hooks map for this definition
	Hooks Hooks
	// used in commands
	Action AppliedAction
	// the total number of containers to scale to.
	Scale int
	// the arguments for docker run / create
	RunArguments []interface{}
	// the project name
	ProjectName string
	// the project name separator, usually "_"
	ProjectNameSeparator string
	// the number of this container, relates to scale
	InstanceNumber int
	// Rm command given, therefore dont run as daemon
	Remove bool
	// Whether or not Blue/Green mode is enabled for this container
	BlueGreenMode BlueGreenMode
	// Is this container enabled or not
	Enabled bool
	// The current state of the container
	State *helpers.ServiceState
}

func (*Container) Attach

func (set *Container) Attach(wg *sync.WaitGroup) error

func (*Container) BlueGreenCopy

func (set *Container) BlueGreenCopy() (newCon *Container)

func (*Container) BlueGreenDeploy

func (set *Container) BlueGreenDeploy(attach bool, dryRun bool, wg *sync.WaitGroup) error

func (*Container) BuildImage

func (set *Container) BuildImage() error

Builds an image for a container

func (*Container) Create

func (set *Container) Create(dryRun bool) error

Run a container

func (*Container) GetRunArguments

func (set *Container) GetRunArguments() []interface{}

Create docker arg slice from container options

func (*Container) IPs

func (set *Container) IPs() string

Returns a containers IP TODO needs to respect scale

func (*Container) Kill

func (set *Container) Kill(args []string) error

Kills the container TODO needs to respect scale

func (*Container) Logs

func (set *Container) Logs() (*sh.Session, error)

Start streaming a container's logs TODO needs to respect scale

func (*Container) NewName

func (set *Container) NewName()

func (*Container) RecreateAndRun

func (set *Container) RecreateAndRun(attach bool, dryRun bool, wg *sync.WaitGroup) error

func (*Container) Restart

func (set *Container) Restart(args []string) error

Restart the container TODO needs to respect scale

func (*Container) Rm

func (set *Container) Rm(args []string) error

Removes the container TODO needs to respect scale

func (*Container) Run

func (set *Container) Run(attach bool, dryRun bool, wg *sync.WaitGroup) error

Run a container

func (*Container) Start

func (set *Container) Start(attach bool, wg *sync.WaitGroup) error

Start a given container TODO needs to respect scale

func (*Container) Stop

func (set *Container) Stop(args []string) error

Stops the container TODO needs to respect scale

type Hook

type Hook struct {
	Scripts []string
	Ses     *shellsession.ShellSession
}

type Hooks

type Hooks map[string]*Hook

func (Hooks) Run

func (h Hooks) Run(hookName string, ctr *Container) error

Runs a hook command if it exists for a specific container

type Link struct {
	Container string
	Alias     string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL