container

package
v0.0.0-...-d69b078 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterConfigDecoder

func RegisterConfigDecoder()

RegisterConfigDecoder registers this config decoder with the engine.

Types

type Action

type Action int

Action a container can be in

const (
	Done Action = iota
	Error
	Creating
	Starting
	Stopping
	Removing
	Needing
)

List of actions

type Config

type Config struct {
	// Create Options
	Name       string   `mapstructure:"name" version:"1"`
	Hostname   string   `mapstructure:"hostname" version:"1"`
	User       string   `mapstructure:"user" version:"1"`
	Memory     string   `mapstructure:"memory" version:"1"`
	CPUShares  int64    `mapstructure:"cpu_shares" version:"1"`
	CPUSet     string   `mapstructure:"cpu_set" version:"1"`
	Attach     []string `mapstructure:"attach" version:"1"`
	Expose     []string `mapstructure:"expose" version:"1"`
	TTY        bool     `mapstructure:"tty" version:"1"`
	Env        []string `mapstructure:"env" version:"1"`
	Cmd        []string `mapstructure:"cmd" version:"1"`
	Image      string   `mapstructure:"image" version:"1"`
	Volumes    []string `mapstructure:"volumes" version:"1"`
	Workdir    string   `mapstructure:"workdir" version:"1"`
	Entrypoint []string `mapstructure:"entrypoint" version:"1"`

	// Start Options
	CapAdd      []string `mapstructure:"cap_add" version:"1"`
	CapDrop     []string `mapstructure:"cap_drop" version:"1"`
	CIDFile     string   `mapstructure:"cid_file" version:"1" lastversion:"1"`
	LXCConf     []string `mapstructure:"lxc_conf" version:"1" lastversion:"1"`
	Privileged  bool     `mapstructure:"privileged" version:"1"`
	Publish     []string `mapstructure:"publish" version:"1"`
	PublishAll  bool     `mapstructure:"publish_all" version:"1"`
	Links       []string `mapstructure:"link" version:"1"`
	DNS         []string `mapstructure:"dns" version:"1"`
	DNSSearch   []string `mapstructure:"dns_search" version:"1"`
	VolumesFrom []string `mapstructure:"volumes_from" version:"1"`
	Net         string   `mapstructure:"net" version:"1"`

	// We set these, no override allowed
	Detach   bool `mapstructure:"-" version:"0" lastversion:"0"`
	SigProxy bool `mapstructure:"-" version:"0" lastversion:"0"`

	// No support in the API?
	Device []string `mapstructure:"device" version:"1"`

	// Stacker options
	Remove       bool     `mapstructure:"remove" version:"1"`
	Restart      string   `mapstructure:"restart" version:"1"`
	Dependencies []string `mapstructure:"dependencies" version:"1"`
	State        string   `mapstructure:"state" version:"1"`
}

Config object for a container

func NewConfig

func NewConfig() *Config

NewConfig returns a ContainerConfig with defaults

func (*Config) Hash

func (c *Config) Hash() string

Hash returns the unique hash for this config object

func (*Config) Target

func (c *Config) Target() *engine.NameSpace

Target returns the namespace of the target of this config

func (*Config) Version

func (c *Config) Version() int

Version returns the version of the config TODO: needs actual code

type ConfigDecoder

type ConfigDecoder struct{}

ConfigDecoder object

func (*ConfigDecoder) DecodeConfig

func (cd *ConfigDecoder) DecodeConfig(data interface{}) (engine.Config, error)

DecodeConfig returns a parsed config object

type Container

type Container struct {
	sync.Mutex
	ID   string
	Name string
	Hash string

	DockerState *dockerapi.State
	Config      *Config

	Channel chan string
	// contains filtered or unexported fields
}

Container represents a container

func NewContainer

func NewContainer(name string, eng *engine.Engine) *Container

NewContainer makes a new Container object

func (*Container) Command

func (c *Container) Command(cmd *engine.Command) error

Command takes a Command object, and triggers events

func (*Container) Dependencies

func (c *Container) Dependencies() []string

Dependencies of this container

type List

type List struct {
	Containers []*Container
}

List of Containers we know about

func NewList

func NewList() *List

NewList returns a new container List object

func (*List) Add

func (cl *List) Add(name string, eng *engine.Engine) (*Container, error)

Add adds a container to the container List

func (*List) BuildNewList

func (cl *List) BuildNewList(eng *engine.Engine) error

BuildNewList (re)creates the internal container list of config and running containers

func (*List) GetNameFromID

func (cl *List) GetNameFromID(id string) string

func (*List) Length

func (cl *List) Length() int

Length of the container list

func (*List) React

func (cl *List) React(id string, event string) error

React to something TODO: RENAME

Jump to

Keyboard shortcuts

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