domain

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package domain contains SDK-agnostic domain models for Docker operations. These types are designed to be independent of any specific Docker client implementation.

Index

Constants

View Source
const (
	EventTypeContainer = "container"
	EventTypeImage     = "image"
	EventTypeVolume    = "volume"
	EventTypeNetwork   = "network"
	EventTypeDaemon    = "daemon"
	EventTypePlugin    = "plugin"
	EventTypeService   = "service"
	EventTypeNode      = "node"
	EventTypeSecret    = "secret"
	EventTypeConfig    = "config"
)

Common event types.

View Source
const (
	EventActionCreate       = "create"
	EventActionStart        = "start"
	EventActionStop         = "stop"
	EventActionDie          = "die"
	EventActionKill         = "kill"
	EventActionPause        = "pause"
	EventActionUnpause      = "unpause"
	EventActionRestart      = "restart"
	EventActionOOM          = "oom"
	EventActionDestroy      = "destroy"
	EventActionRename       = "rename"
	EventActionUpdate       = "update"
	EventActionHealthStatus = "health_status"
	EventActionExecCreate   = "exec_create"
	EventActionExecStart    = "exec_start"
	EventActionExecDie      = "exec_die"
	EventActionAttach       = "attach"
	EventActionDetach       = "detach"
	EventActionCommit       = "commit"
	EventActionCopy         = "copy"
	EventActionArchivePath  = "archive-path"
	EventActionExtractToDir = "extract-to-dir"
	EventActionExport       = "export"
	EventActionTop          = "top"
	EventActionResize       = "resize"

	// Image events
	EventActionPull   = "pull"
	EventActionPush   = "push"
	EventActionTag    = "tag"
	EventActionUntag  = "untag"
	EventActionDelete = "delete"
	EventActionImport = "import"
	EventActionSave   = "save"
	EventActionLoad   = "load"

	// Volume events
	EventActionMount   = "mount"
	EventActionUnmount = "unmount"

	// Network events
	EventActionConnect    = "connect"
	EventActionDisconnect = "disconnect"
	EventActionRemove     = "remove"
)

Common event actions.

Variables

View Source
var (
	// ErrNotFound indicates a resource was not found.
	ErrNotFound = errors.New("resource not found")

	// ErrConflict indicates a resource conflict (e.g., name already exists).
	ErrConflict = errors.New("resource conflict")

	// ErrUnauthorized indicates authentication failure.
	ErrUnauthorized = errors.New("unauthorized")

	// ErrForbidden indicates permission denied.
	ErrForbidden = errors.New("forbidden")

	// ErrTimeout indicates an operation timed out.
	ErrTimeout = errors.New("operation timed out")

	// ErrCanceled indicates an operation was canceled.
	ErrCanceled = errors.New("operation canceled")

	// ErrConnectionFailed indicates a connection failure.
	ErrConnectionFailed = errors.New("connection failed")

	// ErrMaxTimeRunning indicates a job exceeded its maximum runtime.
	ErrMaxTimeRunning = errors.New("maximum time running exceeded")
)

Common domain errors.

Functions

func IsCanceled

func IsCanceled(err error) bool

IsCanceled returns true if the error indicates cancellation.

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if the error indicates a resource conflict.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error indicates a resource was not found.

func IsTimeout

func IsTimeout(err error) bool

IsTimeout returns true if the error indicates a timeout.

Types

type AuthConfig

type AuthConfig struct {
	Username      string
	Password      string
	Auth          string // Base64 encoded "username:password"
	Email         string
	ServerAddress string
	IdentityToken string
	RegistryToken string
}

AuthConfig contains authorization information for connecting to a registry.

type AuthConfigurations

type AuthConfigurations struct {
	Configs map[string]AuthConfig
}

AuthConfigurations contains a map of registry addresses to auth configs.

type BindOptions

type BindOptions struct {
	Propagation string // "private", "rprivate", "shared", "rshared", "slave", "rslave"
}

BindOptions represents options for bind mounts.

type ClusterInfo

type ClusterInfo struct {
	ID                     string
	Version                ServiceVersion
	CreatedAt              time.Time
	UpdatedAt              time.Time
	RootRotationInProgress bool
}

ClusterInfo represents information about the Swarm cluster.

type ComponentVersion

type ComponentVersion struct {
	Name    string
	Version string
	Details map[string]string
}

ComponentVersion represents version info for a component.

type Container

type Container struct {
	ID      string
	Name    string
	Image   string
	State   ContainerState
	Created time.Time
	Labels  map[string]string
	Mounts  []Mount
	Config  *ContainerConfig
}

Container represents a Docker container.

type ContainerConfig

type ContainerConfig struct {
	// Basic configuration
	Image        string
	Cmd          []string
	Entrypoint   []string
	Env          []string
	WorkingDir   string
	User         string
	Labels       map[string]string
	Hostname     string
	AttachStdin  bool
	AttachStdout bool
	AttachStderr bool
	Tty          bool
	OpenStdin    bool
	StdinOnce    bool

	// Host configuration
	HostConfig *HostConfig

	// Networking configuration
	NetworkConfig *NetworkConfig

	// Container name (optional)
	Name string
}

ContainerConfig represents the configuration for creating a container.

type ContainerNotFoundError

type ContainerNotFoundError struct {
	ID string
}

ContainerNotFoundError indicates a container was not found.

func (*ContainerNotFoundError) Error

func (e *ContainerNotFoundError) Error() string

func (*ContainerNotFoundError) Is

func (e *ContainerNotFoundError) Is(target error) bool

Is implements error matching.

type ContainerSpec

type ContainerSpec struct {
	Image     string
	Labels    map[string]string
	Command   []string
	Args      []string
	Hostname  string
	Env       []string
	Dir       string
	User      string
	Mounts    []ServiceMount
	TTY       bool
	OpenStdin bool
}

ContainerSpec represents the container specification for a service.

type ContainerState

type ContainerState struct {
	Running    bool
	Paused     bool
	Restarting bool
	OOMKilled  bool
	Dead       bool
	Pid        int
	ExitCode   int
	Error      string
	StartedAt  time.Time
	FinishedAt time.Time
	Health     *Health
}

ContainerState represents the state of a container.

type ContainerStatus

type ContainerStatus struct {
	ContainerID string
	PID         int
	ExitCode    int
}

ContainerStatus represents the container status within a task.

type ContainerSummary

type ContainerSummary struct {
	ID         string
	Names      []string
	Image      string
	ImageID    string
	Command    string
	Created    int64
	State      string
	Status     string
	SizeRw     int64
	SizeRootFs int64
}

ContainerSummary represents a container summary for disk usage.

type DiskUsage

type DiskUsage struct {
	LayersSize int64
	Images     []ImageSummary
	Containers []ContainerSummary
	Volumes    []VolumeSummary
}

DiskUsage represents disk usage information.

type Driver

type Driver struct {
	Name    string
	Options map[string]string
}

Driver represents a volume driver configuration.

type EndpointIPAMConfig

type EndpointIPAMConfig struct {
	IPv4Address  string
	IPv6Address  string
	LinkLocalIPs []string
}

EndpointIPAMConfig represents IPAM settings for an endpoint.

type EndpointResource

type EndpointResource struct {
	Name        string
	EndpointID  string
	MacAddress  string
	IPv4Address string
	IPv6Address string
}

EndpointResource contains network endpoint resources.

type EndpointSettings

type EndpointSettings struct {
	IPAMConfig          *EndpointIPAMConfig
	Links               []string
	Aliases             []string
	NetworkID           string
	EndpointID          string
	Gateway             string
	IPAddress           string
	IPPrefixLen         int
	IPv6Gateway         string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	MacAddress          string
	DriverOpts          map[string]string
}

EndpointSettings represents the settings for a network endpoint.

type EndpointSpec

type EndpointSpec struct {
	Mode  ResolutionMode
	Ports []PortConfig
}

EndpointSpec represents the endpoint specification for a service.

type Event

type Event struct {
	// Type of event (container, image, volume, network, daemon, plugin, service, node, secret, config)
	Type string

	// Action that triggered the event (create, start, stop, die, kill, etc.)
	Action string

	// Actor that triggered the event
	Actor EventActor

	// Scope of the event (local, swarm)
	Scope string

	// Time when the event occurred
	Time time.Time

	// TimeNano is the time in nanoseconds
	TimeNano int64
}

Event represents a Docker event.

func (*Event) GetContainerID

func (e *Event) GetContainerID() string

GetContainerID returns the container ID from the event, if applicable.

func (*Event) IsContainerStopEvent

func (e *Event) IsContainerStopEvent() bool

IsContainerStopEvent returns true if the event indicates a container has stopped.

type EventActor

type EventActor struct {
	// ID of the object
	ID string

	// Attributes contain key-value pairs with additional info about the object
	Attributes map[string]string
}

EventActor contains information about the object that triggered the event.

type EventFilter

type EventFilter struct {
	// Since filters events after this time
	Since time.Time

	// Until filters events before this time
	Until time.Time

	// Filters is a map of filter types to filter values
	// Keys: container, event, image, label, network, type, volume, daemon, service, node, scope
	Filters map[string][]string
}

EventFilter represents filters for subscribing to events.

type ExecConfig

type ExecConfig struct {
	// Command to run
	Cmd []string

	// Environment variables
	Env []string

	// Working directory
	WorkingDir string

	// User to run the command as
	User string

	// Attach streams
	AttachStdin  bool
	AttachStdout bool
	AttachStderr bool

	// Allocate pseudo-TTY
	Tty bool

	// Detach from the exec after starting
	Detach bool

	// Privileged mode
	Privileged bool
}

ExecConfig represents the configuration for creating an exec instance.

type ExecInspect

type ExecInspect struct {
	ID            string
	ContainerID   string
	Running       bool
	ExitCode      int
	Pid           int
	ProcessConfig *ExecProcessConfig
}

ExecInspect represents the result of inspecting an exec instance.

type ExecNotFoundError

type ExecNotFoundError struct {
	ID string
}

ExecNotFoundError indicates an exec instance was not found.

func (*ExecNotFoundError) Error

func (e *ExecNotFoundError) Error() string

func (*ExecNotFoundError) Is

func (e *ExecNotFoundError) Is(target error) bool

Is implements error matching.

type ExecProcessConfig

type ExecProcessConfig struct {
	User       string
	Privileged bool
	Tty        bool
	Entrypoint string
	Arguments  []string
}

ExecProcessConfig represents the process configuration for an exec instance.

type ExecStartOptions

type ExecStartOptions struct {
	Detach bool
	Tty    bool

	// Stdin to attach (optional)
	Stdin io.Reader

	// Output streams
	OutputStream io.Writer
	ErrorStream  io.Writer
}

ExecStartOptions represents options for starting an exec instance.

type GlobalService

type GlobalService struct{}

GlobalService represents a global service mode.

type Health

type Health struct {
	Status        string // "healthy", "unhealthy", "starting", "none"
	FailingStreak int
	Log           []HealthCheckResult
}

Health represents container health check status.

type HealthCheckResult

type HealthCheckResult struct {
	Start    time.Time
	End      time.Time
	ExitCode int
	Output   string
}

HealthCheckResult represents a single health check result.

type HijackedResponse

type HijackedResponse struct {
	Conn   io.Closer
	Reader io.Reader
}

HijackedResponse represents a hijacked connection for exec.

func (*HijackedResponse) Close

func (h *HijackedResponse) Close() error

Close closes the hijacked connection.

type HostConfig

type HostConfig struct {
	// Resource limits
	Memory     int64 // Memory limit in bytes
	MemorySwap int64 // Total memory limit (memory + swap)
	CPUShares  int64 // CPU shares (relative weight)
	CPUPeriod  int64 // CPU CFS period
	CPUQuota   int64 // CPU CFS quota
	NanoCPUs   int64 // CPU limit in units of 10^-9 CPUs

	// Binds and mounts
	Binds  []string // Volume bindings in format "host:container[:options]"
	Mounts []Mount  // Mount configurations

	// Networking
	NetworkMode  string   // Network mode (bridge, host, none, container:<name|id>)
	PortBindings PortMap  // Port mappings
	DNS          []string // DNS servers
	DNSSearch    []string // DNS search domains
	ExtraHosts   []string // Extra hosts in format "hostname:IP"

	// Security
	Privileged     bool     // Run in privileged mode
	CapAdd         []string // Capabilities to add
	CapDrop        []string // Capabilities to drop
	SecurityOpt    []string // Security options
	ReadonlyRootfs bool     // Mount root filesystem as read-only

	// Runtime
	AutoRemove    bool          // Automatically remove container when it exits
	RestartPolicy RestartPolicy // Restart policy

	// Logging
	LogConfig LogConfig // Logging configuration

	// Other
	PidMode    string            // PID namespace mode
	UsernsMode string            // User namespace mode
	ShmSize    int64             // Size of /dev/shm in bytes
	Tmpfs      map[string]string // Tmpfs mounts
	Ulimits    []Ulimit          // Ulimit settings
}

HostConfig contains the host-specific configuration for a container.

type IPAM

type IPAM struct {
	Driver  string
	Options map[string]string
	Config  []IPAMConfig
}

IPAM represents IP Address Management configuration.

type IPAMConfig

type IPAMConfig struct {
	Subnet     string
	IPRange    string
	Gateway    string
	AuxAddress map[string]string
}

IPAMConfig represents IPAM configuration for a network.

type Image

type Image struct {
	ID          string
	RepoTags    []string
	RepoDigests []string
	Comment     string
	Created     time.Time
	Size        int64
	Labels      map[string]string
}

Image represents a Docker image.

type ImageListOptions

type ImageListOptions struct {
	All     bool                // Show all images (default hides intermediate)
	Filters map[string][]string // Filters to apply
}

ImageListOptions represents options for listing images.

type ImageNotFoundError

type ImageNotFoundError struct {
	Image string
}

ImageNotFoundError indicates an image was not found.

func (*ImageNotFoundError) Error

func (e *ImageNotFoundError) Error() string

func (*ImageNotFoundError) Is

func (e *ImageNotFoundError) Is(target error) bool

Is implements error matching.

type ImageSummary

type ImageSummary struct {
	ID          string
	ParentID    string
	RepoTags    []string
	RepoDigests []string
	Created     int64
	Size        int64
	SharedSize  int64
	Labels      map[string]string
	Containers  int64
}

ImageSummary represents a summary of an image for list operations.

type ListOptions

type ListOptions struct {
	All     bool                // Show all containers (default shows just running)
	Size    bool                // Show size
	Limit   int                 // Max number of containers to return
	Filters map[string][]string // Filters to apply
}

ListOptions represents options for listing containers.

type LocalNodeState

type LocalNodeState string

LocalNodeState represents the state of the local Swarm node.

const (
	LocalNodeStateInactive LocalNodeState = "inactive"
	LocalNodeStatePending  LocalNodeState = "pending"
	LocalNodeStateActive   LocalNodeState = "active"
	LocalNodeStateError    LocalNodeState = "error"
	LocalNodeStateLocked   LocalNodeState = "locked"
)

type LogConfig

type LogConfig struct {
	Type   string            // Logging driver type (json-file, syslog, etc.)
	Config map[string]string // Driver-specific options
}

LogConfig represents logging configuration for a container.

type LogDriver

type LogDriver struct {
	Name    string
	Options map[string]string
}

LogDriver represents logging driver configuration.

type LogOptions

type LogOptions struct {
	ShowStdout bool
	ShowStderr bool
	Since      string // Show logs since timestamp or relative time
	Until      string // Show logs until timestamp or relative time
	Timestamps bool   // Add timestamps to output
	Follow     bool   // Follow log output
	Tail       string // Number of lines to show from the end
	Details    bool   // Show extra details
}

LogOptions represents options for retrieving container logs.

type LogsReader

type LogsReader interface {
	io.ReadCloser
}

LogsReader provides methods to read container logs.

type Mount

type Mount struct {
	Type          MountType
	Source        string
	Target        string
	ReadOnly      bool
	Consistency   string
	BindOptions   *BindOptions
	VolumeOptions *VolumeOptions
	TmpfsOptions  *TmpfsOptions
}

Mount represents a mount configuration.

type MountType

type MountType string

MountType represents the type of mount.

const (
	MountTypeBind   MountType = "bind"
	MountTypeVolume MountType = "volume"
	MountTypeTmpfs  MountType = "tmpfs"
	MountTypeNpipe  MountType = "npipe"
)

type Network

type Network struct {
	Name       string
	ID         string
	Created    time.Time
	Scope      string // local, global, swarm
	Driver     string
	EnableIPv6 bool
	IPAM       IPAM
	Internal   bool
	Attachable bool
	Ingress    bool
	Containers map[string]EndpointResource
	Options    map[string]string
	Labels     map[string]string
}

Network represents a Docker network.

type NetworkAttachment

type NetworkAttachment struct {
	Target  string // Network ID or name
	Aliases []string
}

NetworkAttachment represents a network attachment for a service.

type NetworkConfig

type NetworkConfig struct {
	EndpointsConfig map[string]*EndpointSettings
}

NetworkConfig contains networking configuration for a container.

type NetworkConnectOptions

type NetworkConnectOptions struct {
	Container      string
	EndpointConfig *EndpointSettings
}

NetworkConnectOptions represents options for connecting a container to a network.

type NetworkListOptions

type NetworkListOptions struct {
	Filters map[string][]string
}

NetworkListOptions represents options for listing networks.

type NetworkNotFoundError

type NetworkNotFoundError struct {
	Network string
}

NetworkNotFoundError indicates a network was not found.

func (*NetworkNotFoundError) Error

func (e *NetworkNotFoundError) Error() string

func (*NetworkNotFoundError) Is

func (e *NetworkNotFoundError) Is(target error) bool

Is implements error matching.

type ParsedReference

type ParsedReference struct {
	Repository string
	Tag        string
	Digest     string
}

ParsedReference represents a parsed image reference.

func ParseRepositoryTag

func ParseRepositoryTag(repoTag string) ParsedReference

ParseRepositoryTag parses a repository:tag string into its components.

type Peer

type Peer struct {
	NodeID string
	Addr   string
}

Peer represents a remote manager in the swarm.

type PingResponse

type PingResponse struct {
	APIVersion     string
	OSType         string
	Experimental   bool
	BuilderVersion string
}

PingResponse represents the response from a ping.

type Placement

type Placement struct {
	Constraints []string
	Preferences []PlacementPreference
}

Placement represents placement constraints.

type PlacementPreference

type PlacementPreference struct {
	Spread *SpreadOver
}

PlacementPreference represents a placement preference.

type Platform

type Platform struct {
	Name string
}

Platform represents the platform information.

type Port

type Port string

Port represents a container port.

type PortBinding

type PortBinding struct {
	HostIP   string
	HostPort string
}

PortBinding represents a port binding.

type PortConfig

type PortConfig struct {
	Name          string
	Protocol      PortProtocol
	TargetPort    uint32
	PublishedPort uint32
	PublishMode   PortPublishMode
}

PortConfig represents a port configuration for a service.

type PortMap

type PortMap map[Port][]PortBinding

PortMap is a map of ports to their bindings.

type PortProtocol

type PortProtocol string

PortProtocol represents the protocol for a port.

const (
	PortProtocolTCP  PortProtocol = "tcp"
	PortProtocolUDP  PortProtocol = "udp"
	PortProtocolSCTP PortProtocol = "sctp"
)

type PortPublishMode

type PortPublishMode string

PortPublishMode represents how a port is published.

const (
	PortPublishModeIngress PortPublishMode = "ingress"
	PortPublishModeHost    PortPublishMode = "host"
)

type ProgressDetail

type ProgressDetail struct {
	Current int64
	Total   int64
}

ProgressDetail represents detailed progress information.

type PullOptions

type PullOptions struct {
	// Repository to pull (e.g., "alpine", "nginx:latest")
	Repository string

	// Tag to pull (if not included in repository)
	Tag string

	// Platform to pull (e.g., "linux/amd64")
	Platform string

	// RegistryAuth is base64 encoded auth config
	RegistryAuth string
}

PullOptions represents options for pulling an image.

type PullProgress

type PullProgress struct {
	Status         string
	ProgressDetail ProgressDetail
	ID             string
	Error          string
}

PullProgress represents progress information during an image pull.

type PullReader

type PullReader interface {
	io.ReadCloser
}

PullReader provides methods to read image pull progress.

type RemoveOptions

type RemoveOptions struct {
	RemoveVolumes bool // Remove associated volumes
	RemoveLinks   bool // Remove associated links
	Force         bool // Force removal of running container
}

RemoveOptions represents options for removing a container.

type ReplicatedService

type ReplicatedService struct {
	Replicas *uint64
}

ReplicatedService represents a replicated service mode.

type ResolutionMode

type ResolutionMode string

ResolutionMode represents the endpoint resolution mode.

const (
	ResolutionModeVIP   ResolutionMode = "vip"
	ResolutionModeDNSRR ResolutionMode = "dnsrr"
)

type ResourceRequirements

type ResourceRequirements struct {
	Limits       *Resources
	Reservations *Resources
}

ResourceRequirements represents resource constraints.

type Resources

type Resources struct {
	NanoCPUs    int64
	MemoryBytes int64
}

Resources represents resource limits/reservations.

type RestartCondition

type RestartCondition string

RestartCondition represents when to restart a task.

const (
	RestartConditionNone      RestartCondition = "none"
	RestartConditionOnFailure RestartCondition = "on-failure"
	RestartConditionAny       RestartCondition = "any"
)

type RestartPolicy

type RestartPolicy struct {
	Name              string // "no", "always", "on-failure", "unless-stopped"
	MaximumRetryCount int
}

RestartPolicy represents the restart policy for a container.

type Runtime

type Runtime struct {
	Path string
	Args []string
}

Runtime represents a container runtime.

type Service

type Service struct {
	ID   string
	Meta ServiceMeta
	Spec ServiceSpec
	// Endpoint contains the exposed ports
	Endpoint ServiceEndpoint
}

Service represents a Docker Swarm service.

type ServiceCreateOptions

type ServiceCreateOptions struct {
	// EncodedRegistryAuth is the base64url encoded auth configuration
	EncodedRegistryAuth string
}

ServiceCreateOptions represents options for creating a service.

type ServiceEndpoint

type ServiceEndpoint struct {
	Spec  *EndpointSpec
	Ports []PortConfig
}

ServiceEndpoint represents the endpoint info for a service.

type ServiceListOptions

type ServiceListOptions struct {
	Filters map[string][]string
}

ServiceListOptions represents options for listing services.

type ServiceMeta

type ServiceMeta struct {
	Version   ServiceVersion
	CreatedAt time.Time
	UpdatedAt time.Time
}

ServiceMeta contains metadata about a service.

type ServiceMode

type ServiceMode struct {
	Replicated *ReplicatedService
	Global     *GlobalService
}

ServiceMode represents how the service should be scheduled.

type ServiceMount

type ServiceMount struct {
	Type     MountType
	Source   string
	Target   string
	ReadOnly bool
}

ServiceMount represents a mount for a service container.

type ServiceNotFoundError

type ServiceNotFoundError struct {
	ID string
}

ServiceNotFoundError indicates a service was not found.

func (*ServiceNotFoundError) Error

func (e *ServiceNotFoundError) Error() string

func (*ServiceNotFoundError) Is

func (e *ServiceNotFoundError) Is(target error) bool

Is implements error matching.

type ServiceRemoveOptions

type ServiceRemoveOptions struct {
}

ServiceRemoveOptions represents options for removing a service.

type ServiceRestartPolicy

type ServiceRestartPolicy struct {
	Condition   RestartCondition
	Delay       *time.Duration
	MaxAttempts *uint64
	Window      *time.Duration
}

ServiceRestartPolicy represents the restart policy for a service.

type ServiceSpec

type ServiceSpec struct {
	Name         string
	Labels       map[string]string
	TaskTemplate TaskSpec
	Mode         ServiceMode
	Networks     []NetworkAttachment
	EndpointSpec *EndpointSpec
}

ServiceSpec contains the specification for a service.

type ServiceVersion

type ServiceVersion struct {
	Index uint64
}

ServiceVersion contains version information for a service.

type SpreadOver

type SpreadOver struct {
	SpreadDescriptor string
}

SpreadOver represents spread placement configuration.

type SwarmInfo

type SwarmInfo struct {
	NodeID           string
	NodeAddr         string
	LocalNodeState   LocalNodeState
	ControlAvailable bool
	Error            string
	RemoteManagers   []Peer
	Nodes            int
	Managers         int
	Cluster          *ClusterInfo
}

SwarmInfo represents Swarm-related information.

type SystemInfo

type SystemInfo struct {
	ID                 string
	Containers         int
	ContainersRunning  int
	ContainersPaused   int
	ContainersStopped  int
	Images             int
	Driver             string
	DriverStatus       [][2]string
	SystemStatus       [][2]string
	MemoryLimit        bool
	SwapLimit          bool
	KernelMemory       bool
	CPUCfsPeriod       bool
	CPUCfsQuota        bool
	CPUShares          bool
	CPUSet             bool
	PidsLimit          bool
	IPv4Forwarding     bool
	BridgeNfIptables   bool
	BridgeNfIP6tables  bool
	Debug              bool
	NFd                int
	OomKillDisable     bool
	NGoroutines        int
	SystemTime         string
	LoggingDriver      string
	CgroupDriver       string
	CgroupVersion      string
	NEventsListener    int
	KernelVersion      string
	OperatingSystem    string
	OSVersion          string
	OSType             string
	Architecture       string
	IndexServerAddress string
	NCPU               int
	MemTotal           int64
	DockerRootDir      string
	HTTPProxy          string
	HTTPSProxy         string
	NoProxy            string
	Name               string
	Labels             []string
	ExperimentalBuild  bool
	ServerVersion      string
	Runtimes           map[string]Runtime
	DefaultRuntime     string
	Swarm              SwarmInfo
	LiveRestoreEnabled bool
	Isolation          string
	InitBinary         string
	SecurityOptions    []string
	Warnings           []string
}

SystemInfo represents Docker system information.

type Task

type Task struct {
	ID           string
	ServiceID    string
	NodeID       string
	Status       TaskStatus
	DesiredState TaskState
	Spec         TaskSpec
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

Task represents a Swarm task.

type TaskListOptions

type TaskListOptions struct {
	Filters map[string][]string
}

TaskListOptions represents options for listing tasks.

type TaskSpec

type TaskSpec struct {
	ContainerSpec ContainerSpec
	Resources     *ResourceRequirements
	RestartPolicy *ServiceRestartPolicy
	Placement     *Placement
	Networks      []NetworkAttachment
	LogDriver     *LogDriver
}

TaskSpec represents the specification for a task.

type TaskState

type TaskState string

TaskState represents the state of a task.

const (
	TaskStateNew       TaskState = "new"
	TaskStatePending   TaskState = "pending"
	TaskStateAssigned  TaskState = "assigned"
	TaskStateAccepted  TaskState = "accepted"
	TaskStatePreparing TaskState = "preparing"
	TaskStateReady     TaskState = "ready"
	TaskStateStarting  TaskState = "starting"
	TaskStateRunning   TaskState = "running"
	TaskStateComplete  TaskState = "complete"
	TaskStateShutdown  TaskState = "shutdown"
	TaskStateFailed    TaskState = "failed"
	TaskStateRejected  TaskState = "rejected"
	TaskStateRemove    TaskState = "remove"
	TaskStateOrphaned  TaskState = "orphaned"
)

func (TaskState) IsTerminalState

func (s TaskState) IsTerminalState() bool

IsTerminalState returns true if the task is in a terminal state.

type TaskStatus

type TaskStatus struct {
	Timestamp       time.Time
	State           TaskState
	Message         string
	Err             string
	ContainerStatus *ContainerStatus
}

TaskStatus represents the status of a task.

type TmpfsOptions

type TmpfsOptions struct {
	SizeBytes int64
	Mode      uint32
}

TmpfsOptions represents options for tmpfs mounts.

type Ulimit

type Ulimit struct {
	Name string
	Soft int64
	Hard int64
}

Ulimit represents a ulimit setting.

type Version

type Version struct {
	Platform      Platform
	Components    []ComponentVersion
	Version       string
	APIVersion    string
	MinAPIVersion string
	GitCommit     string
	GoVersion     string
	Os            string
	Arch          string
	KernelVersion string
	BuildTime     string
}

Version represents Docker version information.

type VolumeOptions

type VolumeOptions struct {
	NoCopy       bool
	Labels       map[string]string
	DriverConfig *Driver
}

VolumeOptions represents options for volume mounts.

type VolumeSummary

type VolumeSummary struct {
	Name       string
	Driver     string
	Mountpoint string
	CreatedAt  string
	Labels     map[string]string
	Scope      string
	Options    map[string]string
	UsageData  *VolumeUsageData
}

VolumeSummary represents a volume summary for disk usage.

type VolumeUsageData

type VolumeUsageData struct {
	Size     int64
	RefCount int64
}

VolumeUsageData represents volume usage data.

type WaitError

type WaitError struct {
	Message string
}

WaitError represents an error from the container wait operation.

type WaitResponse

type WaitResponse struct {
	StatusCode int64
	Error      *WaitError
}

WaitResponse contains the response from waiting for a container.

Jump to

Keyboard shortcuts

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