docker

package
v0.0.0-...-bc96e6b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// local unique ID for continer
	ID string

	// optional human-readble name for container, or ID
	Name string

	// Current running state
	Running bool

	// internal IPv4 address assigned to container
	IPv4 net.IP

	// internal hostname for container, or short ID
	Hostname string

	// basename of image used to run container
	Image string

	// exposed, published ports
	Ports []Port

	// XXX: configured image, run labels?
	Labels map[string]string
}

func (Container) String

func (self Container) String() string

type ContainerEvent

type ContainerEvent struct {
	ID     string
	Status string

	// Interpretation of State.Running *after* this event; depends on Status
	Running bool

	// Current state of container; may be inconsistent or missing
	State *Container
}

func (ContainerEvent) String

func (self ContainerEvent) String() string

type Docker

type Docker struct {

	// convenience info from docker
	Version string

	// XXX: not supported on docker 1.3.3
	Name string
	// contains filtered or unexported fields
}

func (*Docker) List

func (self *Docker) List() (out []*Container, err error)

* Full list of (running) containers. * * TODO: somehow synchronize this with Subscribe() events to ensure consistency during listings?

func (*Docker) String

func (self *Docker) String() string

func (*Docker) Subscribe

func (self *Docker) Subscribe() (chan ContainerEvent, error)

* Subscribe to container events.

func (*Docker) Sync

func (self *Docker) Sync() (chan ContainerEvent, error)

* Combine List() and Subscribe() to synchronize to docker container states. * * Gives initial "sync" events for all containers, and then normal events for changes.

type DockerConfig

type DockerConfig struct {
	Endpoint string
}

func (DockerConfig) Open

func (self DockerConfig) Open() (*Docker, error)

type Port

type Port struct {
	Proto string
	Port  uint16

	// exposed
	HostIP   string
	HostPort uint16
}

Jump to

Keyboard shortcuts

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