docker

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatColumn

func FormatColumn(cp *ContainerPort, maxWidth int) string

FormatColumn formats a ContainerPort for display in the Container column.

func IsDockerProcess

func IsDockerProcess(name string) bool

IsDockerProcess returns true if the process name is a known Docker daemon process.

func KillContainer added in v0.1.12

func KillContainer(ctx context.Context, containerID string) error

KillContainer sends SIGKILL to a Docker container.

func StopContainer added in v0.1.12

func StopContainer(ctx context.Context, containerID string, timeoutSecs int) error

StopContainer sends a stop signal to a Docker container. Timeout is the seconds to wait before force-killing.

Types

type ContainerPort

type ContainerPort struct {
	Container     model.ContainerInfo
	HostPort      int
	ContainerPort int
	Protocol      string
}

ContainerPort maps a host port to its container and internal port.

type ResolveResult added in v0.1.12

type ResolveResult struct {
	Ports      map[int]*ContainerPort
	Containers []model.VirtualContainer
}

ResolveResult holds both port mappings and virtual containers from a Docker query.

type Resolver

type Resolver interface {
	Resolve(ctx context.Context) (*ResolveResult, error)
}

Resolver resolves host ports to Docker container info.

func NewResolver

func NewResolver() Resolver

NewResolver creates a Resolver that talks to the Docker daemon.

Jump to

Keyboard shortcuts

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