Documentation
¶
Index ¶
- func CountImageUsage(images []image.Summary, containers []container.Summary) imagetypes.UsageCounts
- type DockerClientService
- func (s *DockerClientService) Close()
- func (s *DockerClientService) DockerHost() string
- func (s *DockerClientService) EventBus() *bus.DockerEventBus
- func (s *DockerClientService) GetAllContainers(ctx context.Context) ([]container.Summary, int, int, int, error)
- func (s *DockerClientService) GetAllImages(ctx context.Context) ([]image.Summary, imagetypes.UsageCounts, error)
- func (s *DockerClientService) GetAllNetworks(ctx context.Context) ([]network.Summary, int, int, int, error)
- func (s *DockerClientService) GetAllVolumes(ctx context.Context) ([]*volume.Volume, int, int, int, error)
- func (s *DockerClientService) GetClient(ctx context.Context) (*client.Client, error)
- func (s *DockerClientService) GetSnapshot(ctx context.Context, envID string) (*dashboardtypes.DockerSnapshot, error)
- func (s *DockerClientService) ListContainers(ctx context.Context) ([]container.Summary, error)
- func (s *DockerClientService) ListImages(ctx context.Context) ([]image.Summary, error)
- func (s *DockerClientService) RefreshClient(ctx context.Context) error
- func (s *DockerClientService) WatchEvents(ctx context.Context)
- func (s *DockerClientService) WithClient(dockerClient *client.Client) *DockerClientService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountImageUsage ¶
func CountImageUsage(images []image.Summary, containers []container.Summary) imagetypes.UsageCounts
CountImageUsage tallies in-use, unused, and total image counts, plus the summed size of all images. An image is in use when a container references its ID.
Types ¶
type DockerClientService ¶
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 (*DockerClientService) GetAllImages ¶
func (s *DockerClientService) GetAllImages(ctx context.Context) ([]image.Summary, imagetypes.UsageCounts, error)
GetAllImages lists images and containers concurrently and returns the images together with their usage counts, including total image size.
func (*DockerClientService) GetAllNetworks ¶
func (*DockerClientService) GetAllVolumes ¶
func (*DockerClientService) GetClient ¶
GetClient returns a singleton Docker client instance. It initializes the client on the first call.
func (*DockerClientService) GetSnapshot ¶
func (s *DockerClientService) GetSnapshot(ctx context.Context, envID string) (*dashboardtypes.DockerSnapshot, error)
func (*DockerClientService) ListContainers ¶
func (*DockerClientService) ListImages ¶
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.