docker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the Docker client with custom methods

func New

func New(host string, logger *logger.Logger) (*Client, error)

New creates a new Docker client wrapper

func (*Client) Close

func (c *Client) Close() error

Close closes the Docker client connection

func (*Client) GetContainer

func (c *Client) GetContainer(ctx context.Context, containerID string) (*client.ContainerInspectResult, error)

GetContainer returns detailed container information

func (*Client) GetContainerLogs

func (c *Client) GetContainerLogs(ctx context.Context, containerID string) (string, error)

GetContainerLogs retrieves container logs

func (*Client) GetHealthStatus

func (c *Client) GetHealthStatus(ctx context.Context, containerNameOrID string) (string, error)

GetHealthStatus returns the health status of a container Returns: "healthy", "unhealthy", "starting", "none"

func (*Client) HasHealthCheck

func (c *Client) HasHealthCheck(ctx context.Context, containerNameOrID string) (bool, error)

HasHealthCheck checks if a container has a health check configured

func (*Client) IsContainerRunning

func (c *Client) IsContainerRunning(ctx context.Context, containerNameOrID string) (bool, error)

IsContainerRunning checks if a container is currently running

func (*Client) ListManagedContainers

func (c *Client) ListManagedContainers(ctx context.Context) ([]container.Summary, error)

ListManagedContainers returns all containers with saltbox_managed=true label

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Ping checks if Docker daemon is accessible

func (*Client) StartContainer

func (c *Client) StartContainer(ctx context.Context, containerID string) error

StartContainer starts a container by name or ID

func (*Client) StopContainer

func (c *Client) StopContainer(ctx context.Context, containerID string, timeout int) error

StopContainer stops a container by name or ID

type ContainerLabels

type ContainerLabels struct {
	Managed               bool
	DependsOn             []string
	DependsOnDelay        int
	DependsOnHealthchecks bool
	ControllerEnabled     bool
}

ContainerLabels represents parsed Saltbox labels

func ParseLabels

func ParseLabels(labels map[string]string) *ContainerLabels

ParseLabels extracts and parses Saltbox-specific labels from a container

func (*ContainerLabels) GetDependencies

func (l *ContainerLabels) GetDependencies() []string

GetDependencies returns the list of container names this container depends on

func (*ContainerLabels) GetStartupDelay

func (l *ContainerLabels) GetStartupDelay() int

GetStartupDelay returns the startup delay in seconds

func (*ContainerLabels) HasDependencies

func (l *ContainerLabels) HasDependencies() bool

HasDependencies returns true if the container has any dependencies

func (*ContainerLabels) IsManaged

func (l *ContainerLabels) IsManaged() bool

IsManaged returns true if the container should be managed by the controller

func (*ContainerLabels) ShouldWaitForHealthcheck

func (l *ContainerLabels) ShouldWaitForHealthcheck() bool

ShouldWaitForHealthcheck returns true if we should wait for health checks

Jump to

Keyboard shortcuts

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