podman

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package podman is a library that uses raw Podman API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteImage

func DeleteImage(ctx context.Context, socket, name string) error

func ListContainer

func ListContainer(ctx context.Context, socket string) (*[]PodmanContainerItem, error)

func ListImages

func ListImages(ctx context.Context, socket string) (*[]PodmanImageItem, error)

func ListPods

func ListPods(ctx context.Context, socket string) (*[]PodmanPodItem, error)

func PullImage

func PullImage(ctx context.Context, socket, name string, identity *PodmanIdentity) error

func RestartContainer

func RestartContainer(ctx context.Context, socket string, name string) error

func StartContainer

func StartContainer(ctx context.Context, socket string, name string) error

func StopContainer

func StopContainer(ctx context.Context, socket string, name string) error

Types

type PodmanContainer

type PodmanContainer struct {
	ID              string                 `json:"Id"`
	Name            string                 `json:"Name"`
	Created         string                 `json:"Created"`
	State           PodmanContainerState   `json:"State"`
	ImageID         string                 `json:"Image"`
	ImageDigest     string                 `json:"ImageDigest"`
	ImageName       string                 `json:"ImageName"`
	PodID           string                 `json:"Pod"`
	Mounts          []PodmanContainerMount `json:"Mounts"`
	NetworkSettings PodmanContainerNetwork `json:"NetworkSettings"`
	Namespace       string                 `json:"Namespace"`
	Config          PodmanContainerConfig  `json:"Config"`
}

PodmanContainer is used to map container inspect.

func InspectContainer

func InspectContainer(ctx context.Context, socket, name string) (*PodmanContainer, error)

type PodmanContainerConfig

type PodmanContainerConfig struct {
	Env         []string          `json:"Env"`
	Cmd         string            `json:"Cmd"`
	Entrypoint  []string          `json:"Entrypoint"`
	Labels      map[string]string `json:"Labels"`
	Annotations map[string]string `json:"Annotations"`
}

PodmanContainerConfig belongs to PodmanContainer.

type PodmanContainerItem

type PodmanContainerItem struct {
	ID    string   `json:"Id"`
	Names []string `json:"Names"`
	State string   `json:"State"`
	Image string   `json:"Image"`
	Pod   string   `json:"Pod"`
}

PodmanContainerItem is used to map the listed containers.

type PodmanContainerMount

type PodmanContainerMount struct {
	Type        string `json:"Type"`
	Name        string `json:"Name"`
	Source      string `json:"Source"`
	Destination string `json:"Destination"`
	Driver      string `json:"Driver"`
	Mode        string `json:"Mode"`
	RW          bool   `json:"RW"`
}

PodmanContainerMount belongs to PodmanContainer.

type PodmanContainerNetwork

type PodmanContainerNetwork struct {
	Ports map[string][]PodmanContainerNetworkPort `json:"Ports"`
}

PodmanContainerNetwork belongs to PodmanContainer.

type PodmanContainerNetworkPort

type PodmanContainerNetworkPort struct {
	HostIP   string `json:"HostIp"`
	HostPort string `json:"HostPort"`
}

PodmanContainerNetworkPort belongs to PodmanContainerNetwork.

type PodmanContainerState

type PodmanContainerState struct {
	Status string `json:"Status"`
	Pid    int    `json:"Pid"`
}

PodmanContainerState belongs to PodmanContainer.

type PodmanIdentity

type PodmanIdentity struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Used to authentication in registry.

type PodmanImage

type PodmanImage struct {
	ID           string            `json:"Id"`
	RepoTags     []string          `json:"RepoTags"`
	RepoDigests  []string          `json:"RepoDigests"`
	Created      string            `json:"Created"`
	Config       PodmanImageConfig `json:"Config"`
	Labels       map[string]string `json:"Labels"`
	Annotations  map[string]string `json:"Annotations"`
	RootFS       PodmanImageRootFS `json:"RootFS"`
	Architecture string            `json:"Architecture"`
	Size         int               `json:"Size"`
	User         string            `json:"User"`
}

PodmanImage is used to inspect an image.

func InspectImage

func InspectImage(ctx context.Context, socket, name string) (*PodmanImage, error)

type PodmanImageConfig

type PodmanImageConfig struct {
	ExposedPorts map[string]any `json:"ExposedPorts"`
	Env          []string       `json:"Env"`
	Entrypoint   []string       `json:"Entrypoint"`
	Cmd          []string       `json:"Cmd"`
	Volumes      map[string]any `json:"Volumes"`
	StopSignal   string         `json:"StopSignal"`
}

PodmanImageConfig belongs to PodmanImage

type PodmanImageItem

type PodmanImageItem struct {
	ID          string            `json:"Id"`
	RepoTags    []string          `json:"RepoTags"`
	RepoDigests []string          `json:"RepoDigests"`
	Created     int               `json:"Created"`
	Size        int               `json:"Size"`
	Labels      map[string]string `json:"Labels"`
	Container   int               `json:"Containers"`
	Digest      string            `json:"Digest"`
	Names       []string          `json:"Names"`
}

PodmanImageItem is used to list images.

type PodmanImageRootFS

type PodmanImageRootFS struct {
	Layers []string `json:"Layers"`
}

PodmanImageRootFS belongs to PodmanImageConfig

type PodmanPodContainer

type PodmanPodContainer struct {
	ID           string `json:"Id"`
	Names        string `json:"Names"`
	Status       string `json:"Status"`
	RestartCount int    `json:"RestartCount"`
}

PodmanPodContainer belongs to PodmanPodItem.

type PodmanPodItem

type PodmanPodItem struct {
	Cgroup     string               `json:"Cgroup"`
	Containers []PodmanPodContainer `json:"Containers"`
	Created    string               `json:"Created"`
	ID         string               `json:"Id"`
	InfraID    string               `json:"InfraId"`
	Name       string               `json:"Name"`
	NameSpace  string               `json:"NameSpace"`
	Networks   []string             `json:"Networks"`
	Status     string               `json:"Status"`
	Labels     map[string]string    `json:"Labels"`
}

PodmanPodItem is used to map the listed pods.

Jump to

Keyboard shortcuts

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