github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/daemon/cluster/executor/backend.go (about)

     1  package executor
     2  
     3  import (
     4  	"io"
     5  	"time"
     6  
     7  	"github.com/docker/docker/api/types"
     8  	"github.com/docker/docker/api/types/container"
     9  	"github.com/docker/docker/api/types/events"
    10  	"github.com/docker/docker/api/types/filters"
    11  	"github.com/docker/docker/api/types/network"
    12  	clustertypes "github.com/docker/docker/daemon/cluster/provider"
    13  	"github.com/docker/libnetwork"
    14  	"github.com/docker/libnetwork/cluster"
    15  	networktypes "github.com/docker/libnetwork/types"
    16  	"golang.org/x/net/context"
    17  )
    18  
    19  // Backend defines the executor component for a swarm agent.
    20  type Backend interface {
    21  	CreateManagedNetwork(clustertypes.NetworkCreateRequest) error
    22  	DeleteManagedNetwork(name string) error
    23  	FindNetwork(idName string) (libnetwork.Network, error)
    24  	SetupIngress(req clustertypes.NetworkCreateRequest, nodeIP string) error
    25  	PullImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error
    26  	CreateManagedContainer(config types.ContainerCreateConfig, validateHostname bool) (types.ContainerCreateResponse, error)
    27  	ContainerStart(name string, hostConfig *container.HostConfig, validateHostname bool, checkpoint string) error
    28  	ContainerStop(name string, seconds int) error
    29  	ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
    30  	UpdateContainerServiceConfig(containerName string, serviceConfig *clustertypes.ServiceConfig) error
    31  	ContainerInspectCurrent(name string, size bool) (*types.ContainerJSON, error)
    32  	ContainerWaitWithContext(ctx context.Context, name string) error
    33  	ContainerRm(name string, config *types.ContainerRmConfig) error
    34  	ContainerKill(name string, sig uint64) error
    35  	SystemInfo() (*types.Info, error)
    36  	VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error)
    37  	Containers(config *types.ContainerListOptions) ([]*types.Container, error)
    38  	SetNetworkBootstrapKeys([]*networktypes.EncryptionKey) error
    39  	SetClusterProvider(provider cluster.Provider)
    40  	IsSwarmCompatible() error
    41  	SubscribeToEvents(since, until time.Time, filter filters.Args) ([]events.Message, chan interface{})
    42  	UnsubscribeFromEvents(listener chan interface{})
    43  	UpdateAttachment(string, string, string, *network.NetworkingConfig) error
    44  	WaitForDetachment(context.Context, string, string, string, string) error
    45  }