forked from docker-archive/classicswarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.go
33 lines (24 loc) · 919 Bytes
/
cluster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cluster
import "github.com/samalba/dockerclient"
type Cluster interface {
// Create a container
CreateContainer(config *dockerclient.ContainerConfig, name string) (*Container, error)
// Remove a container
RemoveContainer(container *Container, force bool) error
// Return all images
Images() []*Image
// Return one image matching `IdOrName`
Image(IdOrName string) *Image
// Return all containers
Containers() []*Container
// Return container the matching `IdOrName`
Container(IdOrName string) *Container
// Pull images
// `callback` can be called multiple time
// `what` is what is being pulled
// `status` is the current status, like "", "in progress" or "downloaded
Pull(name string, callback func(what, status string))
// Return some info about the cluster, like nb or containers / images
// It is pretty open, so the implementation decides what to return.
Info() [][2]string
}