docker

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPreset

func ApplyPreset(
	preset config.PrunePreset,
	images []ImageInfo,
	volumes []VolumeInfo,
	containers []ContainerInfo,
	protection *ProtectionEngine,
) (imageIDs, volumeNames, containerIDs []string)

func CategoryLabel

func CategoryLabel(cat SafetyCategory) string

func EstimateReclaimable

func EstimateReclaimable(
	images []ImageInfo,
	selectedImageIDs []string,
	volumes []VolumeInfo,
	selectedVolumeNames []string,
) int64

Types

type BuildCacheInfo

type BuildCacheInfo struct {
	TotalSize int64
}

type Client

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

func NewClient

func NewClient() (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetDiskUsage

func (c *Client) GetDiskUsage() ([]ImageInfo, []ContainerInfo, []VolumeInfo, BuildCacheInfo, error)

func (*Client) ListContainers

func (c *Client) ListContainers() ([]ContainerInfo, error)

func (*Client) ListImages

func (c *Client) ListImages() ([]ImageInfo, error)

func (*Client) ListNetworks added in v0.2.0

func (c *Client) ListNetworks() ([]NetworkInfo, error)

func (*Client) ListVolumes

func (c *Client) ListVolumes() ([]VolumeInfo, error)

func (*Client) PruneBuildCache

func (c *Client) PruneBuildCache() (int64, error)

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(id string) error

func (*Client) RemoveImage

func (c *Client) RemoveImage(id string) error

func (*Client) RemoveNetwork added in v0.2.0

func (c *Client) RemoveNetwork(id string) error

func (*Client) RemoveVolume

func (c *Client) RemoveVolume(name string) error

type ContainerInfo

type ContainerInfo struct {
	ID      string
	Name    string
	Image   string
	Status  string
	State   string
	Size    int64
	Created time.Time
	Running bool
}

type ImageInfo

type ImageInfo struct {
	ID         string
	Repository string
	Tag        string
	Size       int64
	SharedSize int64
	UniqueSize int64
	Containers int64
	Created    time.Time
	Dangling   bool
}

type NetworkInfo

type NetworkInfo struct {
	ID         string
	Name       string
	Driver     string
	Scope      string
	Containers int
}

type ProtectionEngine

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

func NewProtectionEngine

func NewProtectionEngine(patterns []string) *ProtectionEngine

func (*ProtectionEngine) IsProtected

func (pe *ProtectionEngine) IsProtected(name string) bool

func (*ProtectionEngine) MatchesPattern

func (pe *ProtectionEngine) MatchesPattern(name string) bool

func (*ProtectionEngine) Protect

func (pe *ProtectionEngine) Protect(name string)

func (*ProtectionEngine) Unprotect

func (pe *ProtectionEngine) Unprotect(name string)

type SafetyCategory

type SafetyCategory int
const (
	CategorySafe         SafetyCategory = 1
	CategoryProbablySafe SafetyCategory = 2
	CategoryCheckFirst   SafetyCategory = 3
	CategoryDoNotTouch   SafetyCategory = 4
)

func CategorizeContainer

func CategorizeContainer(
	ctr ContainerInfo,
	protectionPatterns []string,
) SafetyCategory

func CategorizeImage

func CategorizeImage(
	img ImageInfo,
	protectionPatterns []string,
) SafetyCategory

func CategorizeNetwork added in v0.2.0

func CategorizeNetwork(
	net NetworkInfo,
	protectionPatterns []string,
) SafetyCategory

func CategorizeVolume

func CategorizeVolume(
	vol VolumeInfo,
	protectionPatterns []string,
) SafetyCategory

type VolumeInfo

type VolumeInfo struct {
	Name    string
	Size    int64
	Links   int
	Created time.Time
}

Jump to

Keyboard shortcuts

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