Documentation ¶
Index ¶
- func NewCluster(scheduler *scheduler.Scheduler, store *state.Store, ...) cluster.Cluster
- type Node
- func (n *Node) AddContainer(container *cluster.Container) error
- func (n *Node) AddImage(image *cluster.Image)
- func (n *Node) Addr() string
- func (n *Node) CleanupContainers()
- func (n *Node) Connect(config *tls.Config) error
- func (n *Node) Container(IdOrName string) *cluster.Container
- func (n *Node) Containers() []*cluster.Container
- func (n *Node) Create(config *dockerclient.ContainerConfig, name string, pullImage bool) (*cluster.Container, error)
- func (n *Node) Destroy(container *cluster.Container, force bool) error
- func (n *Node) Events(h cluster.EventHandler) error
- func (n *Node) ID() string
- func (n *Node) IP() string
- func (n *Node) Image(IdOrName string) *cluster.Image
- func (n *Node) Images() []*cluster.Image
- func (n *Node) IsConnected() bool
- func (n *Node) IsHealthy() bool
- func (n *Node) Labels() map[string]string
- func (n *Node) Name() string
- func (n *Node) Pull(image string) error
- func (n *Node) RefreshContainer(ID string, full bool) error
- func (n *Node) RefreshContainers(full bool) error
- func (n *Node) RefreshContainersAsync()
- func (n *Node) RemoveContainer(container *cluster.Container) error
- func (n *Node) String() string
- func (n *Node) TotalCpus() int64
- func (n *Node) TotalMemory() int64
- func (n *Node) UsedCpus() int64
- func (n *Node) UsedMemory() int64
- type SwarmCluster
- func (s *SwarmCluster) Container(IdOrName string) *cluster.Container
- func (s *SwarmCluster) Containers() []*cluster.Container
- func (s *SwarmCluster) CreateContainer(config *dockerclient.ContainerConfig, name string) (*cluster.Container, error)
- func (s *SwarmCluster) Handle(e *cluster.Event) error
- func (s *SwarmCluster) Image(IdOrName string) *cluster.Image
- func (s *SwarmCluster) Images() []*cluster.Image
- func (s *SwarmCluster) Info() [][2]string
- func (s *SwarmCluster) RemoveContainer(container *cluster.Container, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
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 ¶
Containers returns all the containers in the node.
func (*Node) Create ¶
func (n *Node) Create(config *dockerclient.ContainerConfig, name string, pullImage bool) (*cluster.Container, error)
func (*Node) Events ¶
func (n *Node) Events(h cluster.EventHandler) error
Register an event handler.
func (*Node) IsConnected ¶
IsConnected returns true if the engine is connected to a remote docker API
func (*Node) RefreshContainer ¶
Refresh the status of a container running on the node. If `full` is true, the container will be inspected.
func (*Node) RefreshContainers ¶
Refresh the list and status of containers running on the node. If `full` is true, each container will be inspected.
func (*Node) RefreshContainersAsync ¶
func (n *Node) RefreshContainersAsync()
func (*Node) RemoveContainer ¶
Remove a container from the internal test.
func (*Node) TotalMemory ¶
func (*Node) UsedMemory ¶
Return the sum of memory reserved by containers.
type SwarmCluster ¶
func (*SwarmCluster) Container ¶
func (s *SwarmCluster) Container(IdOrName string) *cluster.Container
Container returns the container with IdOrName in the cluster
func (*SwarmCluster) Containers ¶
func (s *SwarmCluster) Containers() []*cluster.Container
Containers returns all the containers in the cluster.
func (*SwarmCluster) CreateContainer ¶
func (s *SwarmCluster) CreateContainer(config *dockerclient.ContainerConfig, name string) (*cluster.Container, error)
Schedule a brand new container into the cluster.
func (*SwarmCluster) Handle ¶
func (s *SwarmCluster) Handle(e *cluster.Event) error
callback for the events
func (*SwarmCluster) Image ¶
func (s *SwarmCluster) Image(IdOrName string) *cluster.Image
Image returns an image with IdOrName in the cluster
func (*SwarmCluster) Images ¶
func (s *SwarmCluster) Images() []*cluster.Image
Containers returns all the images in the cluster.
func (*SwarmCluster) Info ¶
func (s *SwarmCluster) Info() [][2]string
func (*SwarmCluster) RemoveContainer ¶
func (s *SwarmCluster) RemoveContainer(container *cluster.Container, force bool) error
Remove a container from the cluster. Containers should always be destroyed through the scheduler to guarantee atomicity.