Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) AddNode(n *Node) error
- func (c *Cluster) Container(IdOrName string) *Container
- func (c *Cluster) Containers() []*Container
- func (c *Cluster) Events(h EventHandler) error
- func (c *Cluster) Handle(e *Event) error
- func (c *Cluster) Node(addr string) *Node
- func (c *Cluster) Nodes() []*Node
- func (c *Cluster) UpdateNodes(nodes []*discovery.Node)
- type Container
- type Event
- type EventHandler
- type Node
- func (n *Node) AddContainer(container *Container) error
- func (n *Node) CleanupContainers()
- func (n *Node) Connect(config *tls.Config) error
- func (n *Node) Containers() []*Container
- func (n *Node) Create(config *dockerclient.ContainerConfig, name string, pullImage bool) (*Container, error)
- func (n *Node) Destroy(container *Container, force bool) error
- func (n *Node) Events(h EventHandler) error
- func (n *Node) IsConnected() bool
- func (n *Node) IsHealthy() bool
- func (n *Node) ListImages() ([]string, error)
- func (n *Node) Pull(image string) error
- func (n *Node) RemoveContainer(container *Container) error
- func (n *Node) ReservedCpus() int64
- func (n *Node) ReservedMemory() int64
- func (n *Node) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNodeNotConnected = errors.New("node is not connected to docker's REST API") ErrNodeAlreadyRegistered = errors.New("node was already added to the cluster") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
func NewCluster ¶
func (*Cluster) AddNode ¶
Register a node within the cluster. The node must have been already initialized.
func (*Cluster) Containers ¶
Containers returns all the containers in the cluster.
func (*Cluster) Events ¶
func (c *Cluster) Events(h EventHandler) error
func (*Cluster) UpdateNodes ¶
type Container ¶
type Container struct { dockerclient.Container Info dockerclient.ContainerInfo // contains filtered or unexported fields }
type Event ¶
type Event struct { dockerclient.Event Node *Node }
type EventHandler ¶
type Node ¶
type Node struct { sync.RWMutex ID string IP string Addr string Name string Cpus int64 Memory int64 Labels map[string]string // contains filtered or unexported fields }
func (*Node) AddContainer ¶
Inject a container into the internal state.
func (*Node) CleanupContainers ¶
func (n *Node) CleanupContainers()
Wipes the internal container state.
func (*Node) Connect ¶
Connect will initialize a connection to the Docker daemon running on the host, gather machine specs (memory, cpu, ...) and monitor state changes.
func (*Node) Containers ¶
func (*Node) Create ¶
func (n *Node) Create(config *dockerclient.ContainerConfig, name string, pullImage bool) (*Container, error)
func (*Node) IsConnected ¶
IsConnected returns true if the engine is connected to a remote docker API
func (*Node) ListImages ¶
func (*Node) RemoveContainer ¶
Remove a container from the internal test.
func (*Node) ReservedCpus ¶
Return the sum of CPUs reserved by containers.
func (*Node) ReservedMemory ¶
Return the sum of memory reserved by containers.
Click to show internal directories.
Click to hide internal directories.