docker

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEventMessage

func FromEventMessage(host domain.HostID, msg events.Message) domain.ContainerEvent

func FromInspect

func FromInspect(host domain.HostID, inspect container.InspectResponse) domain.Container

func FromStats

func FromStats(host domain.HostID, containerID string, stats container.StatsResponse) domain.ContainerStats

func FromSummary

func FromSummary(host domain.HostID, item container.Summary) domain.Container

Types

type LocalProvider

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

func NewLocalProvider

func NewLocalProvider() (*LocalProvider, error)

func NewProvider

func NewProvider(id, name, dockerHost string) (*LocalProvider, error)

func (*LocalProvider) Close

func (p *LocalProvider) Close() error

func (*LocalProvider) Container

func (*LocalProvider) ContainerStats

func (p *LocalProvider) ContainerStats(ctx context.Context, id domain.ResourceID) (domain.ContainerStats, error)

func (*LocalProvider) CreateContainer added in v0.1.2

func (p *LocalProvider) CreateContainer(ctx context.Context, spec app.ContainerCreateSpec) (domain.ResourceID, error)

func (*LocalProvider) CreateNetwork added in v0.1.22

func (p *LocalProvider) CreateNetwork(ctx context.Context, name string) error

CreateNetwork creates a plain user-defined bridge network by name — the same shape `docker network create <name>` produces. Used by Paste when a yanked container's network doesn't already exist on the destination host.

func (*LocalProvider) Events

func (p *LocalProvider) Events(ctx context.Context) (<-chan domain.ContainerEvent, error)

func (*LocalProvider) Host

func (p *LocalProvider) Host() domain.Host

func (*LocalProvider) Images added in v0.1.21

func (p *LocalProvider) Images(ctx context.Context) ([]domain.Image, error)

func (*LocalProvider) KillContainer added in v0.1.30

func (p *LocalProvider) KillContainer(ctx context.Context, id domain.ResourceID) error

func (*LocalProvider) Logs

func (*LocalProvider) Networks added in v0.1.21

func (p *LocalProvider) Networks(ctx context.Context) ([]domain.Network, error)

Networks inspects each listed network before deriving attachment counts. The Docker client currently aliases network.Summary to network.Inspect, but its own docs allow list responses to diverge from full inspect data; removable/delete UI should not trust a possibly-sparse list response.

func (*LocalProvider) Ping

func (p *LocalProvider) Ping(ctx context.Context) error

func (*LocalProvider) PullImage added in v0.1.2

func (p *LocalProvider) PullImage(ctx context.Context, image string, onProgress func(app.PullProgress)) error

PullImage decodes the pull's streamed JSON messages itself (rather than delegating to jsonmessage.DisplayJSONMessagesStream, which formats them for a human-readable io.Writer) so onProgress can drive a real status-bar indicator instead of the messages being discarded. Error detection mirrors DisplayJSONMessagesStream exactly (see JSONMessage.Display in the vendored source): a message's Error field fails the pull; nothing else does — in particular the deprecated ErrorMessage string field is never checked, matching today's behavior.

func (*LocalProvider) RemoveContainer added in v0.1.2

func (p *LocalProvider) RemoveContainer(ctx context.Context, id domain.ResourceID, force bool) error

func (*LocalProvider) RemoveImage added in v0.1.21

func (p *LocalProvider) RemoveImage(ctx context.Context, ref string) error

RemoveImage deliberately leaves Force false so Docker protects images that are still referenced by a container or another image tag.

func (*LocalProvider) RemoveNetwork added in v0.1.21

func (p *LocalProvider) RemoveNetwork(ctx context.Context, id string) error

func (*LocalProvider) RemoveVolume added in v0.1.21

func (p *LocalProvider) RemoveVolume(ctx context.Context, name string) error

RemoveVolume deliberately leaves force false, matching RemoveImage's default, so Docker protects volumes still referenced by a container.

func (*LocalProvider) RenameContainer added in v0.1.22

func (p *LocalProvider) RenameContainer(ctx context.Context, id domain.ResourceID, name string) error

func (*LocalProvider) RestartContainer

func (p *LocalProvider) RestartContainer(ctx context.Context, id domain.ResourceID) error

func (*LocalProvider) ServerVersion added in v0.1.25

func (p *LocalProvider) ServerVersion(ctx context.Context) (version, apiVersion string, err error)

ServerVersion reports the connected daemon's version and negotiated API version — not part of the app.Provider interface (no UI caller needs it today), but useful diagnostic detail for cmd/whatthedock's doctor command, which talks to LocalProvider directly rather than through the generic interface for exactly this kind of extra detail.

func (*LocalProvider) SetContainerPaused added in v0.1.30

func (p *LocalProvider) SetContainerPaused(ctx context.Context, id domain.ResourceID, paused bool) error

func (*LocalProvider) Snapshot

func (p *LocalProvider) Snapshot(ctx context.Context) (domain.Snapshot, error)

func (*LocalProvider) StartContainer

func (p *LocalProvider) StartContainer(ctx context.Context, id domain.ResourceID) error

func (*LocalProvider) StopContainer

func (p *LocalProvider) StopContainer(ctx context.Context, id domain.ResourceID) error

func (*LocalProvider) Volumes added in v0.1.21

func (p *LocalProvider) Volumes(ctx context.Context) ([]domain.Volume, error)

Volumes cross-references VolumeList against a fresh ContainerList (whose summary Mounts already carry each mount's Type and volume Name) to derive InUse, rather than trusting VolumeList's own usage data, which Docker only populates when explicitly requested and can be slow to compute.

Jump to

Keyboard shortcuts

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