Help us shape the future of Go! Take the 2026 Go Developer Survey

docker

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountImageUsage

func CountImageUsage(images []image.Summary, containers []container.Summary) (inuse int, unused int, total int)

Types

type DockerClientService

type DockerClientService struct {
	*client.Client
	// contains filtered or unexported fields
}

func NewDockerClientService

func NewDockerClientService(_ context.Context, db *database.DB, cfg *config.Config, settingsService *settings.SettingsService) *DockerClientService

func (*DockerClientService) Close

func (s *DockerClientService) Close()

Close closes the cached Docker client.

func (*DockerClientService) DockerHost

func (s *DockerClientService) DockerHost() string

DockerHost returns the configured DOCKER_HOST value.

func (*DockerClientService) EventBus

func (s *DockerClientService) EventBus() *bus.DockerEventBus

func (*DockerClientService) GetAllContainers

func (s *DockerClientService) GetAllContainers(ctx context.Context) ([]container.Summary, int, int, int, error)

func (*DockerClientService) GetAllImages

func (s *DockerClientService) GetAllImages(ctx context.Context) ([]image.Summary, int, int, int, error)

func (*DockerClientService) GetAllNetworks

func (s *DockerClientService) GetAllNetworks(ctx context.Context) ([]network.Summary, int, int, int, error)

func (*DockerClientService) GetAllVolumes

func (s *DockerClientService) GetAllVolumes(ctx context.Context) ([]*volume.Volume, int, int, int, error)

func (*DockerClientService) GetClient

func (s *DockerClientService) GetClient(ctx context.Context) (*client.Client, error)

GetClient returns a singleton Docker client instance. It initializes the client on the first call.

func (*DockerClientService) GetSnapshot

func (*DockerClientService) ListContainers

func (s *DockerClientService) ListContainers(ctx context.Context) ([]container.Summary, error)

func (*DockerClientService) ListImages

func (s *DockerClientService) ListImages(ctx context.Context) ([]image.Summary, error)

func (*DockerClientService) RefreshClient

func (s *DockerClientService) RefreshClient(ctx context.Context) error

RefreshClient probes the Docker daemon and recreates the cached client when the daemon's effective API version changed.

func (*DockerClientService) WatchEvents

func (s *DockerClientService) WatchEvents(ctx context.Context)

func (*DockerClientService) WithClient

func (s *DockerClientService) WithClient(dockerClient *client.Client) *DockerClientService

WithClient returns a copy of the service bound to an already-connected Docker client, skipping host discovery. Used where the caller owns the connection.

Jump to

Keyboard shortcuts

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