github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/daemon/cluster/executor/backend.go (about) 1 package executor 2 3 import ( 4 "io" 5 "time" 6 7 "github.com/docker/distribution" 8 "github.com/docker/distribution/reference" 9 "github.com/docker/docker/api/types" 10 "github.com/docker/docker/api/types/backend" 11 "github.com/docker/docker/api/types/container" 12 "github.com/docker/docker/api/types/events" 13 "github.com/docker/docker/api/types/filters" 14 "github.com/docker/docker/api/types/network" 15 swarmtypes "github.com/docker/docker/api/types/swarm" 16 containerpkg "github.com/docker/docker/container" 17 clustertypes "github.com/docker/docker/daemon/cluster/provider" 18 networkSettings "github.com/docker/docker/daemon/network" 19 "github.com/docker/docker/plugin" 20 "github.com/docker/libnetwork" 21 "github.com/docker/libnetwork/cluster" 22 networktypes "github.com/docker/libnetwork/types" 23 "github.com/docker/swarmkit/agent/exec" 24 "golang.org/x/net/context" 25 ) 26 27 // Backend defines the executor component for a swarm agent. 28 type Backend interface { 29 CreateManagedNetwork(clustertypes.NetworkCreateRequest) error 30 DeleteManagedNetwork(name string) error 31 FindNetwork(idName string) (libnetwork.Network, error) 32 SetupIngress(clustertypes.NetworkCreateRequest, string) (<-chan struct{}, error) 33 ReleaseIngress() (<-chan struct{}, error) 34 PullImage(ctx context.Context, image, tag, platform string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error 35 CreateManagedContainer(config types.ContainerCreateConfig) (container.ContainerCreateCreatedBody, error) 36 ContainerStart(name string, hostConfig *container.HostConfig, checkpoint string, checkpointDir string) error 37 ContainerStop(name string, seconds *int) error 38 ContainerLogs(context.Context, string, *types.ContainerLogsOptions) (msgs <-chan *backend.LogMessage, tty bool, err error) 39 ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error 40 ActivateContainerServiceBinding(containerName string) error 41 DeactivateContainerServiceBinding(containerName string) error 42 UpdateContainerServiceConfig(containerName string, serviceConfig *clustertypes.ServiceConfig) error 43 ContainerInspectCurrent(name string, size bool) (*types.ContainerJSON, error) 44 ContainerWait(ctx context.Context, name string, condition containerpkg.WaitCondition) (<-chan containerpkg.StateStatus, error) 45 ContainerRm(name string, config *types.ContainerRmConfig) error 46 ContainerKill(name string, sig uint64) error 47 SetContainerDependencyStore(name string, store exec.DependencyGetter) error 48 SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error 49 SetContainerConfigReferences(name string, refs []*swarmtypes.ConfigReference) error 50 SystemInfo() (*types.Info, error) 51 VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error) 52 Containers(config *types.ContainerListOptions) ([]*types.Container, error) 53 SetNetworkBootstrapKeys([]*networktypes.EncryptionKey) error 54 DaemonJoinsCluster(provider cluster.Provider) 55 DaemonLeavesCluster() 56 IsSwarmCompatible() error 57 SubscribeToEvents(since, until time.Time, filter filters.Args) ([]events.Message, chan interface{}) 58 UnsubscribeFromEvents(listener chan interface{}) 59 UpdateAttachment(string, string, string, *network.NetworkingConfig) error 60 WaitForDetachment(context.Context, string, string, string, string) error 61 GetRepository(context.Context, reference.Named, *types.AuthConfig) (distribution.Repository, bool, error) 62 LookupImage(name string) (*types.ImageInspect, error) 63 PluginManager() *plugin.Manager 64 PluginGetter() *plugin.Store 65 GetAttachmentStore() *networkSettings.AttachmentStore 66 }