Documentation ¶
Index ¶
- Constants
- func Deploy(ctx context.Context, dockerCli command.Cli, opts DeployOptions) error
- func List(ctx context.Context, apiclient client.APIClient) ([]*formatter.Stack, error)
- func ListServices(ctx context.Context, client client.APIClient, options types.ServiceListOptions) ([]swarm.Service, error)
- func ListTasks(ctx context.Context, client client.APIClient, options types.TaskListOptions) ([]swarm.Task, error)
- func MessageString(m events.Message) string
- func NotifyState(ctx context.Context, apiClient apiclient.APIClient, serviceID string, ...)
- func Remove(dockerCli command.Cli, opts RemoveOptions) error
- type DeployOptions
- type EventsWatcher
- type EventsWatcherOptions
- func NewEventsWatcherOptions(eventTypes ...string) *EventsWatcherOptions
- func NewEventsWatcherOptionsBetween(since, until string, eventTypes ...string) *EventsWatcherOptions
- func NewEventsWatcherOptionsSince(since string, eventTypes ...string) *EventsWatcherOptions
- func NewEventsWatcherOptionsUntil(until string, eventTypes ...string) *EventsWatcherOptions
- func (o *EventsWatcherOptions) AddAttributesFilter(key, value string)
- func (o *EventsWatcherOptions) AddAttributesFilters(attrs map[string]string)
- func (o *EventsWatcherOptions) AddContainerEventTypeFilter()
- func (o *EventsWatcherOptions) AddDaemonEventTypeFilter()
- func (o *EventsWatcherOptions) AddImageFilter(id string)
- func (o *EventsWatcherOptions) AddNetworkEventTypeFilter()
- func (o *EventsWatcherOptions) AddNodeEventTypeFilter()
- func (o *EventsWatcherOptions) AddPluginEventTypeFilter()
- func (o *EventsWatcherOptions) AddScopeFilter(scope string)
- func (o *EventsWatcherOptions) AddSecretEventTypeFilter()
- func (o *EventsWatcherOptions) AddServiceEventTypeFilter()
- func (o *EventsWatcherOptions) AddTypeFilters(eventTypes ...string)
- func (o *EventsWatcherOptions) AddVolumeEventTypeFilter()
- func (o *EventsWatcherOptions) SetEventsOptions(opts types.EventsOptions)
- func (o *EventsWatcherOptions) Since(value string)
- func (o *EventsWatcherOptions) Until(value string)
- type PsOptions
- type RemoveOptions
- type ServicesOptions
Constants ¶
const ( DefaultNetworkDriver = "overlay" ResolveImageAlways = "always" ResolveImageChanged = "changed" ResolveImageNever = "never" )
Variables ¶
This section is empty.
Functions ¶
func ListServices ¶
func MessageString ¶
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
Types ¶
type DeployOptions ¶
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 RemoveOptions ¶
type RemoveOptions struct {
Namespaces []string
}
type ServicesOptions ¶
type ServicesOptions struct {
// contains filtered or unexported fields
}