Documentation
¶
Index ¶
- type Client
- type ClientOptions
- type Container
- func (c Container) GetLabel(key string) string
- func (c Container) GetScope() string
- func (c Container) GetStopSignal() string
- func (c Container) GetStopTimeout(defaultTimeout time.Duration) time.Duration
- func (c Container) HasLabel(key string) bool
- func (c Container) IsEnabled(labelName string, defaultEnabled bool) bool
- func (c Container) IsHealthy() bool
- func (c Container) IsRunning() bool
- func (c Container) IsUnhealthy() bool
- func (c Container) UpdateEnabled() bool
- func (c Container) WatchEnabled() bool
- type ListOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Ping() error
ListContainers(ctx context.Context, opts ListOptions) ([]Container, error)
GetContainer(ctx context.Context, id string) (Container, error)
StopContainer(ctx context.Context, id string, timeout time.Duration) error
StartContainer(ctx context.Context, id string) error
RestartContainer(ctx context.Context, id string, timeout time.Duration) error
RemoveContainer(ctx context.Context, id string) error
RenameContainer(ctx context.Context, id string, newName string) error
RecreateContainer(ctx context.Context, id string, timeout time.Duration) (string, error)
PullImage(ctx context.Context, imageName string) error
GetImageDigest(ctx context.Context, imageName string) (string, error)
GetImageID(ctx context.Context, imageName string) (string, error)
RemoveImage(ctx context.Context, imageID string) error
ContainerLogs(ctx context.Context, id string, follow bool, tail string) (io.ReadCloser, error)
CloneContainer(ctx context.Context, id string, newName string) (string, error)
GetSelfContainerID() string
GetContainerBinds(ctx context.Context, id string) ([]string, error)
CreateHelperContainer(ctx context.Context, image string, cmd []string, binds []string) (string, error)
}
Client interface for Docker operations
func NewClient ¶
func NewClient(opts ClientOptions) (Client, error)
NewClient creates a new Docker client
type ClientOptions ¶
ClientOptions configures the Docker client
type Container ¶
type Container struct {
ID string
Name string
Image string
ImageID string
State string
Status string
Labels map[string]string
Created time.Time
HealthStatus string
}
Container represents a Docker container
func (Container) GetStopSignal ¶
GetStopSignal returns the configured stop signal or default
func (Container) GetStopTimeout ¶
GetStopTimeout returns the configured stop timeout or default
func (Container) IsEnabled ¶
IsEnabled returns true if the container should be managed by DockWarden
func (Container) IsUnhealthy ¶
IsUnhealthy returns true if the container is unhealthy
func (Container) UpdateEnabled ¶
UpdateEnabled returns true if updates are enabled for this container
func (Container) WatchEnabled ¶
WatchEnabled returns true if health watching is enabled for this container
type ListOptions ¶
ListOptions for filtering containers
Click to show internal directories.
Click to hide internal directories.