stack

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetworkDriver = "overlay"
	ResolveImageAlways   = "always"
	ResolveImageChanged  = "changed"
	ResolveImageNever    = "never"
)

Variables

This section is empty.

Functions

func Deploy

func Deploy(ctx context.Context, dockerCli command.Cli, opts DeployOptions) error

func List

func List(ctx context.Context, apiclient client.APIClient) ([]*formatter.Stack, error)

func ListServices

func ListServices(ctx context.Context, client client.APIClient, options types.ServiceListOptions) ([]swarm.Service, error)

func ListTasks

func ListTasks(ctx context.Context, client client.APIClient, options types.TaskListOptions) ([]swarm.Task, error)

func MessageString

func MessageString(m events.Message) string

MessageString returns a formatted event message

func NotifyState

func NotifyState(ctx context.Context, apiClient apiclient.APIClient, serviceID string, desiredState swarm.TaskState, stabilizeDelay time.Duration, callback func(error))

NotifyState calls the provided callback when the desired service state is achieved for all tasks or when the deadline is exceeded

func Remove

func Remove(dockerCli command.Cli, opts RemoveOptions) error

Types

type DeployOptions

type DeployOptions struct {
	Bundlefile       string
	Composefile      string
	Namespace        string
	ResolveImage     string
	SendRegistryAuth bool
	Prune            bool
	ExpectedState    swarm.TaskState
}

type EventsWatcher

type EventsWatcher interface {
	On(action string, handler func(events.Message))
	OnError(handler func(error))
	Watch()
	Cancel()
}

EventsWatcher is the interface for watching and reacting to events EventsWatcher inspired by github.com/docker/cli/cli/command/event_utils.go:EventHandler

func NewEventsWatcher

func NewEventsWatcher(ctx context.Context, apiClient client.APIClient, opts *EventsWatcherOptions) EventsWatcher

NewEventsWatcher returns a new watcher instance

func NewEventsWatcherWithCancel

func NewEventsWatcherWithCancel(ctx context.Context, apiClient client.APIClient, opts *EventsWatcherOptions) EventsWatcher

NewEventsWatcherWithCancel returns a new cancelable watcher instance

type EventsWatcherOptions

type EventsWatcherOptions struct {
	Options types.EventsOptions
}

func NewEventsWatcherOptions

func NewEventsWatcherOptions(eventTypes ...string) *EventsWatcherOptions

func NewEventsWatcherOptionsBetween

func NewEventsWatcherOptionsBetween(since, until string, eventTypes ...string) *EventsWatcherOptions

func NewEventsWatcherOptionsSince

func NewEventsWatcherOptionsSince(since string, eventTypes ...string) *EventsWatcherOptions

func NewEventsWatcherOptionsUntil

func NewEventsWatcherOptionsUntil(until string, eventTypes ...string) *EventsWatcherOptions

func (*EventsWatcherOptions) AddAttributesFilter

func (o *EventsWatcherOptions) AddAttributesFilter(key, value string)

AddAttributesFilter adds a filter to match the supplied key-value pair

func (*EventsWatcherOptions) AddAttributesFilters

func (o *EventsWatcherOptions) AddAttributesFilters(attrs map[string]string)

AddAttributesFilters adds a filter to match the supplied attributes map

func (*EventsWatcherOptions) AddContainerEventTypeFilter

func (o *EventsWatcherOptions) AddContainerEventTypeFilter()

AddContainerEventTypeFilter adds a filter that matches event "type" == "container"

func (*EventsWatcherOptions) AddDaemonEventTypeFilter

func (o *EventsWatcherOptions) AddDaemonEventTypeFilter()

AddDaemonEventTypeFilter adds a filter that matches event "type" == "daemon"

func (*EventsWatcherOptions) AddImageFilter

func (o *EventsWatcherOptions) AddImageFilter(id string)

AddImageFilter adds a filter that matches "image" to an image name or ID

func (*EventsWatcherOptions) AddNetworkEventTypeFilter

func (o *EventsWatcherOptions) AddNetworkEventTypeFilter()

AddNetworkEventTypeFilter adds a filter that matches event "type" == "network"

func (*EventsWatcherOptions) AddNodeEventTypeFilter

func (o *EventsWatcherOptions) AddNodeEventTypeFilter()

AddNodeEventTypeFilter adds a filter that matches event "type" == "node"

func (*EventsWatcherOptions) AddPluginEventTypeFilter

func (o *EventsWatcherOptions) AddPluginEventTypeFilter()

AddPluginEventTypeFilter adds a filter that matches event "type" == "plugin"

func (*EventsWatcherOptions) AddScopeFilter

func (o *EventsWatcherOptions) AddScopeFilter(scope string)

AddScopeFilter adds a filter to match an event.Scope to the provided scope

func (*EventsWatcherOptions) AddSecretEventTypeFilter

func (o *EventsWatcherOptions) AddSecretEventTypeFilter()

AddSecretEventTypeFilter adds a filter that matches event "type" == "secret"

func (*EventsWatcherOptions) AddServiceEventTypeFilter

func (o *EventsWatcherOptions) AddServiceEventTypeFilter()

AddServiceEventTypeFilter adds a filter that matches event "type" == "service"

func (*EventsWatcherOptions) AddTypeFilters

func (o *EventsWatcherOptions) AddTypeFilters(eventTypes ...string)

AddTypeFilter adds a filter arg for each specified type (or use the explicit convenience helper methods (AddXXXEventTypeFilter)) See: githuo.com/docker/docker/api/types/events/events.go - "container" - "daemon" - "image" - "network" - "plugin" - "volume" - "service" - "node" - "secret" AddTypeFilters adds a list of type filters at once

func (*EventsWatcherOptions) AddVolumeEventTypeFilter

func (o *EventsWatcherOptions) AddVolumeEventTypeFilter()

AddVolumeEventTypeFilter adds a filter that matches event "type" == "volume"

func (*EventsWatcherOptions) SetEventsOptions

func (o *EventsWatcherOptions) SetEventsOptions(opts types.EventsOptions)

SetEventsOptions is used if to provide an explicit set of options; otherwise, use a combination of the other convenience option helpers (Since, Until, Add*) before calling Subscribe

func (*EventsWatcherOptions) Since

func (o *EventsWatcherOptions) Since(value string)

Since is a duration (relative to now) or a RFC3339 timestamp or a unix timestamp See: githuo.com/docker/docker/api/types/time/timestamp.go

func (*EventsWatcherOptions) Until

func (o *EventsWatcherOptions) Until(value string)

Until is a duration (relative to now) or a RFC3339 timestamp or a unix timestamp See: githuo.com/docker/docker/api/types/time/timestamp.go

type PsOptions

type PsOptions struct {
	// contains filtered or unexported fields
}

type RemoveOptions

type RemoveOptions struct {
	Namespaces []string
}

type ServicesOptions

type ServicesOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL