controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package controller provides the logic for interacting with container engines.

Package controller provides the logic for interacting with container engines.

Package controller provides the logic for interacting with container engines.

Package controller provides the logic for interacting with container engines.

Package controller provides the logic for interacting with container engines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvancedCleanup

func AdvancedCleanup() (string, error)

AdvancedCleanup removes dangling volumes and dangling images.

func BasicCleanup

func BasicCleanup() (string, error)

BasicCleanup removes stopped containers, unused networks, and unused images.

func GetContainerLogs

func GetContainerLogs(idOrName string) (string, error)

GetContainerLogs retrieves the logs of a container.

func InspectContainer

func InspectContainer(idOrName string) (string, error)

InspectContainer inspects a container by its ID or name and returns its raw JSON output.

func InspectNetwork

func InspectNetwork(idOrName string) (string, error)

InspectNetwork inspects a network and returns its raw JSON output.

func RemoveContainer

func RemoveContainer(idOrName string) error

RemoveContainer removes a container by its ID or name.

func RemoveImage

func RemoveImage(idOrName string) error

RemoveImage removes an image by its ID or name.

func RemoveVolume

func RemoveVolume(name string) error

RemoveVolume removes a volume by its name.

func StartContainer

func StartContainer(idOrName string) error

StartContainer starts a container by its ID or name.

func StopContainer

func StopContainer(idOrName string) error

StopContainer stops a container by its ID or name.

func TotalCleanup

func TotalCleanup() (string, error)

TotalCleanup prunes all unused containers, images, volumes, and networks.

Types

type Container

type Container struct {
	ID      string
	Image   string
	Command string
	Created string
	Status  string
	Ports   string
	Names   string
}

Container represents a container's simplified information.

func ListContainers

func ListContainers() ([]Container, error)

ListContainers lists all running and stopped containers.

type Image

type Image struct {
	ID         string
	Repository string
	Tag        string
	Size       string
	Created    string
}

Image represents an image's simplified information.

func ListImages

func ListImages() ([]Image, error)

ListImages lists all images.

type Network

type Network struct {
	ID     string
	Name   string
	Driver string
	Scope  string
}

Network represents a network's simplified information.

func ListNetworks

func ListNetworks() ([]Network, error)

ListNetworks lists all networks.

type SystemInfo

type SystemInfo struct {
	Containers int // Total number of containers.
	Running    int // Number of running containers.
	Paused     int // Number of paused containers.
	Stopped    int // Number of stopped containers.
	Images     int // Total number of images.
	Volumes    int // Total number of volumes.
	Networks   int // Total number of networks.
	DiskUsage  string
}

SystemInfo holds system-wide statistics about containers, images, volumes, and networks.

func GetSystemInfo

func GetSystemInfo() (SystemInfo, error)

GetSystemInfo retrieves system-wide information about containers, images, and volumes.

type Volume

type Volume struct {
	Name       string
	Driver     string
	Scope      string
	Mountpoint string
}

Volume represents a volume's simplified information.

func ListVolumes

func ListVolumes() ([]Volume, error)

ListVolumes lists all volumes.

Jump to

Keyboard shortcuts

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