Help us shape the future of Go! Take the 2026 Go Developer Survey

podman

package
v2.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(host string) (*Client, error)

func (*Client) ContainerList

func (c *Client) ContainerList(ctx context.Context, labels, pods []string) ([]podmantypes.Container, error)

func (*Client) Info

func (c *Client) Info(ctx context.Context) (podmantypes.Info, error)

func (*Client) KubeDown

func (*Client) KubeGenerate

func (c *Client) KubeGenerate(ctx context.Context, req podmantypes.KubeGenerateRequest) (string, error)

func (*Client) KubePlay

func (*Client) PodAction

func (c *Client) PodAction(ctx context.Context, nameOrID string, action PodAction, opts PodActionOptions) error

func (*Client) PodCreate

func (c *Client) PodCreate(ctx context.Context, spec PodSpec) (string, error)

func (*Client) PodInspect

func (c *Client) PodInspect(ctx context.Context, nameOrID string) (podmantypes.PodInspect, error)

func (*Client) PodList

func (c *Client) PodList(ctx context.Context, filters map[string][]string) ([]podmantypes.Pod, error)

func (*Client) PodPrune

func (c *Client) PodPrune(ctx context.Context) ([]podmantypes.PodPruneReport, error)

func (*Client) PodRemove

func (c *Client) PodRemove(ctx context.Context, nameOrID string, force bool) error

func (*Client) PodStats

func (c *Client) PodStats(ctx context.Context, namesOrIDs []string) ([]podmantypes.PodStats, error)

func (*Client) PodTop

func (c *Client) PodTop(ctx context.Context, nameOrID, psArgs string) (podmantypes.PodTop, error)

func (*Client) QuadletFile

func (c *Client) QuadletFile(ctx context.Context, name string) (string, error)

func (*Client) QuadletInstall

func (*Client) QuadletList

func (c *Client) QuadletList(ctx context.Context, filters map[string][]string) ([]podmantypes.Quadlet, error)

func (*Client) QuadletRemove

func (*Client) SecretCreate

func (c *Client) SecretCreate(ctx context.Context, req podmantypes.SecretCreateRequest, replace bool) (string, error)

func (*Client) SecretInspect

func (c *Client) SecretInspect(ctx context.Context, nameOrID string) (podmantypes.Secret, error)

func (*Client) SecretList

func (c *Client) SecretList(ctx context.Context, filters map[string][]string) ([]podmantypes.Secret, error)

func (*Client) SecretRemove

func (c *Client) SecretRemove(ctx context.Context, nameOrID string) error

func (*Client) Version

func (c *Client) Version(ctx context.Context) (podmantypes.Version, error)

type Features

type Features struct {
	QuadletsSupported    bool
	QuadletAppsSupported bool
	AutoUpdateMode       podmantypes.AutoUpdateMode
}

func DetectFeatures

func DetectFeatures(version string, systemdAvailable bool) Features

type PodAction

type PodAction string
const (
	PodActionStart   PodAction = "start"
	PodActionStop    PodAction = "stop"
	PodActionRestart PodAction = "restart"
	PodActionPause   PodAction = "pause"
	PodActionUnpause PodAction = "unpause"
	PodActionKill    PodAction = "kill"
)

type PodActionOptions

type PodActionOptions struct {
	Timeout *int
	Signal  string
}

type PodBlockIO

type PodBlockIO struct {
	Weight                 *uint16             `json:"weight,omitempty"`
	WeightDevice           []PodWeightDevice   `json:"weightDevice,omitempty"`
	ThrottleReadBpsDevice  []PodThrottleDevice `json:"throttleReadBpsDevice,omitempty"`
	ThrottleWriteBpsDevice []PodThrottleDevice `json:"throttleWriteBpsDevice,omitempty"`
}

type PodCPULimits

type PodCPULimits struct {
	Shares *uint64 `json:"shares,omitempty"`
	Quota  *int64  `json:"quota,omitempty"`
	Period *uint64 `json:"period,omitempty"`
	Cpus   string  `json:"cpus,omitempty"`
	Mems   string  `json:"mems,omitempty"`
}

type PodIDMap

type PodIDMap struct {
	ContainerID int `json:"container_id"`
	HostID      int `json:"host_id"`
	Size        int `json:"size"`
}

type PodIDMappings

type PodIDMappings struct {
	HostUIDMapping bool       `json:"HostUIDMapping"`
	HostGIDMapping bool       `json:"HostGIDMapping"`
	UIDMap         []PodIDMap `json:"UIDMap,omitempty"`
	GIDMap         []PodIDMap `json:"GIDMap,omitempty"`
}

type PodMemoryLimits

type PodMemoryLimits struct {
	Limit *int64 `json:"limit,omitempty"`
	Swap  *int64 `json:"swap,omitempty"`
}

type PodMount

type PodMount struct {
	Destination string   `json:"destination"`
	Type        string   `json:"type"`
	Source      string   `json:"source"`
	Options     []string `json:"options,omitempty"`
}

type PodNamedVolume

type PodNamedVolume struct {
	Name    string   `json:"Name"`
	Dest    string   `json:"Dest"`
	Options []string `json:"Options,omitempty"`
}

type PodNamespace

type PodNamespace struct {
	NSMode string `json:"nsmode,omitempty"`
	Value  string `json:"value,omitempty"`
}

type PodNetworkOptions

type PodNetworkOptions struct {
	StaticIPs     []string `json:"static_ips,omitempty"`
	Aliases       []string `json:"aliases,omitempty"`
	StaticMAC     string   `json:"static_mac,omitempty"`
	InterfaceName string   `json:"interface_name,omitempty"`
}

type PodPortMapping

type PodPortMapping struct {
	ContainerPort uint16 `json:"container_port"`
	HostPort      uint16 `json:"host_port,omitempty"`
	HostIP        string `json:"host_ip,omitempty"`
	Protocol      string `json:"protocol,omitempty"`
	Range         uint16 `json:"range,omitempty"`
}

type PodResources

type PodResources struct {
	Memory  *PodMemoryLimits `json:"memory,omitempty"`
	CPU     *PodCPULimits    `json:"cpu,omitempty"`
	BlockIO *PodBlockIO      `json:"blockIO,omitempty"`
}

type PodSpec

type PodSpec struct {
	Name               string                       `json:"name"`
	Hostname           string                       `json:"hostname,omitempty"`
	ExitPolicy         string                       `json:"exit_policy,omitempty"`
	Labels             map[string]string            `json:"labels,omitempty"`
	NoInfra            bool                         `json:"no_infra,omitempty"`
	InfraConmonPidFile string                       `json:"infra_conmon_pid_file,omitempty"`
	InfraCommand       []string                     `json:"infra_command,omitempty"`
	InfraImage         string                       `json:"infra_image,omitempty"`
	InfraName          string                       `json:"infra_name,omitempty"`
	Ipc                *PodNamespace                `json:"ipcns,omitempty"`
	SharedNamespaces   []string                     `json:"shared_namespaces,omitempty"`
	RestartPolicy      string                       `json:"restart_policy,omitempty"`
	RestartRetries     *uint                        `json:"restart_tries,omitempty"`
	ShareParent        *bool                        `json:"share_parent,omitempty"`
	Pid                *PodNamespace                `json:"pidns,omitempty"`
	Userns             *PodNamespace                `json:"userns,omitempty"`
	Uts                *PodNamespace                `json:"utsns,omitempty"`
	Devices            []string                     `json:"pod_devices,omitempty"`
	Sysctl             map[string]string            `json:"sysctl,omitempty"`
	NetNS              *PodNamespace                `json:"netns,omitempty"`
	PortMappings       []PodPortMapping             `json:"portmappings,omitempty"`
	Networks           map[string]PodNetworkOptions `json:"Networks,omitempty"`
	NoManageResolvConf bool                         `json:"no_manage_resolv_conf,omitempty"`
	DNSServer          []string                     `json:"dns_server,omitempty"`
	DNSSearch          []string                     `json:"dns_search,omitempty"`
	DNSOption          []string                     `json:"dns_option,omitempty"`
	NoManageHostname   bool                         `json:"no_manage_hostname,omitempty"`
	NoManageHosts      bool                         `json:"no_manage_hosts,omitempty"`
	HostAdd            []string                     `json:"hostadd,omitempty"`
	HostsFile          string                       `json:"hostsFile,omitempty"`
	NetworkOptions     map[string][]string          `json:"network_options,omitempty"`
	CgroupParent       string                       `json:"cgroup_parent,omitempty"`
	ResourceLimits     *PodResources                `json:"resource_limits,omitempty"`
	Mounts             []PodMount                   `json:"mounts,omitempty"`
	Volumes            []PodNamedVolume             `json:"volumes,omitempty"`
	VolumesFrom        []string                     `json:"volumes_from,omitempty"`
	ShmSize            *int64                       `json:"shm_size,omitempty"`
	ShmSizeSystemd     *int64                       `json:"shm_size_systemd,omitempty"`
	SecurityOpt        []string                     `json:"security_opt,omitempty"`
	IDMappings         *PodIDMappings               `json:"idmappings,omitempty"`
}

type PodThrottleDevice

type PodThrottleDevice struct {
	Major int64  `json:"major"`
	Minor int64  `json:"minor"`
	Rate  uint64 `json:"rate"`
}

type PodWeightDevice

type PodWeightDevice struct {
	Major  int64   `json:"major"`
	Minor  int64   `json:"minor"`
	Weight *uint16 `json:"weight,omitempty"`
}

type QuadletInstallOptions

type QuadletInstallOptions struct {
	File          podmantypes.QuadletFile
	ExtraFiles    []podmantypes.QuadletFile
	Replace       bool
	Application   string
	AppsSupported bool
}

type QuadletRemoveOptions

type QuadletRemoveOptions struct {
	Force  bool
	Ignore bool
}

type Runtime

type Runtime struct {
	Client   *Client
	Version  podmantypes.Version
	Rootless bool
	Systemd  Systemd
}

type Systemd

type Systemd interface {
	Availability(ctx context.Context) podmantypes.SystemdAvailability
	Start(ctx context.Context, unit string) error
	Stop(ctx context.Context, unit string) error
	Restart(ctx context.Context, unit string) error
	UnitStatus(ctx context.Context, unit string) (podmantypes.UnitStatus, error)
}

func NewSystemd

func NewSystemd(host string, rootless bool, getenv func(string) string) Systemd

Jump to

Keyboard shortcuts

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