maintenance

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("maintenance",
	fx.Provide(NewService),
	fx.Provide(NewHandler),
)

Functions

This section is empty.

Types

type Amount added in v0.5.1

type Amount struct {
	Count int   `json:"count"`
	Size  int64 `json:"size"`
}

type BuildCacheInfo

type BuildCacheInfo struct {
	ID          string     `json:"id"`
	Type        string     `json:"type"`
	Description string     `json:"description"`
	Size        int64      `json:"size"`
	Created     time.Time  `json:"created"`
	LastUsed    *time.Time `json:"last_used"`
	UsageCount  int        `json:"usage_count"`
	InUse       bool       `json:"in_use"`
	Shared      bool       `json:"shared"`
	Removal     Removal    `json:"removal"`
}

type BuildCacheSummary

type BuildCacheSummary struct {
	Total Amount           `json:"total"`
	Cache []BuildCacheInfo `json:"cache"`
}

type ContainerInfo

type ContainerInfo struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Image   string            `json:"image"`
	State   string            `json:"state"`
	Status  string            `json:"status"`
	Created time.Time         `json:"created"`
	Size    int64             `json:"size"`
	Labels  map[string]string `json:"labels"`
	Removal Removal           `json:"removal"`
}

type ContainerSummary

type ContainerSummary struct {
	Total        Amount          `json:"total"`
	RunningCount int             `json:"running_count"`
	Containers   []ContainerInfo `json:"containers"`
}

type DeleteRequest

type DeleteRequest struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type DeleteResult

type DeleteResult struct {
	Type    string `json:"type"`
	ID      string `json:"id"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(maintenanceService *Service, auditService *audit.Service) *Handler

func (*Handler) DeleteResource

func (h *Handler) DeleteResource(c echo.Context) error

func (*Handler) GetSystemInfo

func (h *Handler) GetSystemInfo(c echo.Context) error

func (*Handler) PruneDocker

func (h *Handler) PruneDocker(c echo.Context) error

type ImageInfo

type ImageInfo struct {
	ID         string    `json:"id"`
	Tags       []string  `json:"tags"`
	Size       int64     `json:"size"`
	SharedSize int64     `json:"shared_size"`
	Created    time.Time `json:"created"`
	Containers int       `json:"containers"`
	Dangling   bool      `json:"dangling"`
	Unused     bool      `json:"unused"`
	Removal    Removal   `json:"removal"`
}

type ImageSummary

type ImageSummary struct {
	Total       Amount      `json:"total"`
	UnusedCount int         `json:"unused_count"`
	Images      []ImageInfo `json:"images"`
}

type MaintenanceInfo

type MaintenanceInfo struct {
	SystemInfo          SystemInfo        `json:"system_info"`
	ImageSummary        ImageSummary      `json:"image_summary"`
	ContainerSummary    ContainerSummary  `json:"container_summary"`
	VolumeSummary       VolumeSummary     `json:"volume_summary"`
	NetworkSummary      NetworkSummary    `json:"network_summary"`
	BuildCacheSummary   BuildCacheSummary `json:"build_cache_summary"`
	SystemCleanupCovers []string          `json:"system_cleanup_covers"`
	LastUpdated         time.Time         `json:"last_updated"`
}

type NetworkInfo

type NetworkInfo struct {
	ID       string            `json:"id"`
	Name     string            `json:"name"`
	Driver   string            `json:"driver"`
	Scope    string            `json:"scope"`
	Created  time.Time         `json:"created"`
	Internal bool              `json:"internal"`
	Labels   map[string]string `json:"labels"`
	Unused   bool              `json:"unused"`
	Subnet   string            `json:"subnet"`
	Removal  Removal           `json:"removal"`
}

type NetworkSummary

type NetworkSummary struct {
	TotalCount  int           `json:"total_count"`
	UnusedCount int           `json:"unused_count"`
	Networks    []NetworkInfo `json:"networks"`
}

type PruneRequest

type PruneRequest struct {
	Type string `json:"type"`
	All  bool   `json:"all"`
}

type PruneResult

type PruneResult struct {
	Type           string   `json:"type"`
	ItemsDeleted   []string `json:"items_deleted"`
	SpaceReclaimed int64    `json:"space_reclaimed"`
	Error          string   `json:"error,omitempty"`
}

type Removal added in v0.5.1

type Removal string
const (
	RemovalNever   Removal = "never"
	RemovalWithAll Removal = "with_all"
	RemovalAlways  Removal = "always"
)

type Service

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

func NewService

func NewService(dockerClient *docker.Client, logger *logging.Logger) *Service

func (*Service) DeleteResource

func (s *Service) DeleteResource(ctx context.Context, req *DeleteRequest) (*DeleteResult, error)

func (*Service) GetSystemInfo

func (s *Service) GetSystemInfo(ctx context.Context) (*MaintenanceInfo, error)

func (*Service) PruneDocker

func (s *Service) PruneDocker(ctx context.Context, req *PruneRequest) (*PruneResult, error)

type SystemInfo

type SystemInfo struct {
	Version       string `json:"version"`
	APIVersion    string `json:"api_version"`
	Architecture  string `json:"architecture"`
	OS            string `json:"os"`
	KernelVersion string `json:"kernel_version"`
	TotalMemory   int64  `json:"total_memory"`
	NCPU          int    `json:"ncpu"`
	StorageDriver string `json:"storage_driver"`
	DockerRootDir string `json:"docker_root_dir"`
}

type VolumeInfo

type VolumeInfo struct {
	Name       string            `json:"name"`
	Driver     string            `json:"driver"`
	Mountpoint string            `json:"mountpoint"`
	Created    time.Time         `json:"created"`
	Size       int64             `json:"size"`
	Labels     map[string]string `json:"labels"`
	Anonymous  bool              `json:"anonymous"`
	Unused     bool              `json:"unused"`
	Removal    Removal           `json:"removal"`
}

type VolumeSummary

type VolumeSummary struct {
	Total   Amount       `json:"total"`
	Unused  Amount       `json:"unused"`
	Volumes []VolumeInfo `json:"volumes"`
}

Jump to

Keyboard shortcuts

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