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

podman

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package podman provides the Podman-compatible API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Name      string    `json:"name"`
	Digest    string    `json:"digest"`
	MediaType string    `json:"media_type"`
	Size      int64     `json:"size"`
	Created   time.Time `json:"created"`
}

type Deps added in v0.12.0

type Deps struct {
	Runtime *dokiruntime.Runtime
	Images  *image.Store
	Network *network.Manager
	Volumes VolumeStore
	Events  *events.Bus

	// Build, PlayKube and GenerateKube reuse the daemon's own handlers rather
	// than reimplementing them here (P6/P7). They are function values because
	// those handlers live in pkg/api, which imports this package.
	Build        http.HandlerFunc
	PlayKube     http.HandlerFunc
	GenerateKube http.HandlerFunc
}

Deps carries the real engine components the libpod endpoints operate on. Before these were injected, PodmanServer held only its own metadata stores, so every container, image, volume and network endpoint had nothing to talk to and could only return fiction.

type ManifestEntry

type ManifestEntry struct {
	Image     string   `json:"image"`
	Digest    string   `json:"digest"`
	MediaType string   `json:"mediaType"`
	Platform  Platform `json:"platform"`
}

type ManifestList

type ManifestList struct {
	Name      string          `json:"name"`
	Images    []ManifestEntry `json:"images"`
	MediaType string          `json:"mediaType"`
	Created   time.Time       `json:"created"`
	Modified  time.Time       `json:"modified"`
}

type ManifestManager

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

func NewManifestManager

func NewManifestManager(root string) (*ManifestManager, error)

func (*ManifestManager) Add

func (mm *ManifestManager) Add(name, image string, platform Platform) error

func (*ManifestManager) Annotate

func (mm *ManifestManager) Annotate(name, image string, platform Platform) error

func (*ManifestManager) Create

func (mm *ManifestManager) Create(name string, images []string) (*ManifestList, error)

func (*ManifestManager) Delete

func (mm *ManifestManager) Delete(name string) error

func (*ManifestManager) Exists

func (mm *ManifestManager) Exists(name string) bool

func (*ManifestManager) Inspect

func (mm *ManifestManager) Inspect(name string) (*ManifestList, error)

func (*ManifestManager) List

func (mm *ManifestManager) List() []*ManifestList

func (*ManifestManager) Remove

func (mm *ManifestManager) Remove(name, image string) error

type NetworkOptions

type NetworkOptions struct {
	Aliases   []string `json:"aliases,omitempty"`
	StaticIP  string   `json:"static_ip,omitempty"`
	StaticMAC string   `json:"static_mac,omitempty"`
}

type Platform

type Platform struct {
	Architecture string   `json:"architecture"`
	OS           string   `json:"os"`
	OSVersion    string   `json:"os.version,omitempty"`
	OSFeatures   []string `json:"os.features,omitempty"`
	Variant      string   `json:"variant,omitempty"`
}

type Pod

type Pod struct {
	ID          string            `json:"Id"`
	Name        string            `json:"Name"`
	Namespace   string            `json:"Namespace,omitempty"`
	Created     time.Time         `json:"Created"`
	Hostname    string            `json:"Hostname,omitempty"`
	Labels      map[string]string `json:"Labels,omitempty"`
	State       string            `json:"State"`
	Containers  []PodContainer    `json:"Containers"`
	InfraID     string            `json:"InfraContainerId"`
	CgroupPath  string            `json:"CgroupPath,omitempty"`
	SharedNS    []string          `json:"SharedNamespaces,omitempty"`
	CPUShares   int64             `json:"CpuShares,omitempty"`
	ExitPolicy  string            `json:"ExitPolicy,omitempty"`
	Restart     string            `json:"Restart,omitempty"`
	MemoryLimit int64             `json:"MemoryLimit,omitempty"`
	ExitSignal  string            `json:"ExitSignal,omitempty"`
}

type PodContainer

type PodContainer struct {
	ID    string `json:"Id"`
	Name  string `json:"Name"`
	State string `json:"State"`
}

type PodCreateConfig

type PodCreateConfig struct {
	Name            string                    `json:"name"`
	Hostname        string                    `json:"hostname,omitempty"`
	DomainName      string                    `json:"domainname,omitempty"`
	Labels          map[string]string         `json:"labels,omitempty"`
	ShareNamespaces []string                  `json:"share_parent,omitempty"`
	InfraImage      string                    `json:"infra_image,omitempty"`
	InfraCommand    []string                  `json:"infra_command,omitempty"`
	InfraName       string                    `json:"infra_name,omitempty"`
	PortBindings    map[string][]PortBinding  `json:"portmappings,omitempty"`
	ExitPolicy      string                    `json:"exit_policy,omitempty"`
	CPUShares       int64                     `json:"cpu_shares,omitempty"`
	MemoryLimit     int64                     `json:"memory_limit,omitempty"`
	CPULimit        float64                   `json:"cpu_limit,omitempty"`
	Restart         string                    `json:"restart,omitempty"`
	Networks        map[string]NetworkOptions `json:"networks,omitempty"`
	SecurityOpt     []string                  `json:"security_opt,omitempty"`
	NoInfra         bool                      `json:"no_infra,omitempty"`
	CgroupParent    string                    `json:"cgroup_parent,omitempty"`
	Pid             string                    `json:"pid,omitempty"`
	Userns          string                    `json:"userns,omitempty"`
	Uts             string                    `json:"uts,omitempty"`
	Volumes         []string                  `json:"volumes,omitempty"`
	DNSOptions      []string                  `json:"dns_option,omitempty"`
	DNSSearch       []string                  `json:"dns_search,omitempty"`
	DNServers       []string                  `json:"dns_server,omitempty"`
	HostAdd         []string                  `json:"hostadd,omitempty"`
}

type PodManager

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

func NewPodManager

func NewPodManager(root string) (*PodManager, error)

func (*PodManager) AddContainerToPod

func (pm *PodManager) AddContainerToPod(podID string, containerID, containerName string) error

func (*PodManager) CreatePod

func (pm *PodManager) CreatePod(cfg *PodCreateConfig) (*Pod, error)

func (*PodManager) Exists

func (pm *PodManager) Exists(nameOrID string) bool

func (*PodManager) GetPod

func (pm *PodManager) GetPod(nameOrID string) (*Pod, error)

func (*PodManager) KillPod

func (pm *PodManager) KillPod(nameOrID string, signal string) error

func (*PodManager) ListPods

func (pm *PodManager) ListPods() []*Pod

func (*PodManager) PausePod

func (pm *PodManager) PausePod(nameOrID string) error

func (*PodManager) PrunePods

func (pm *PodManager) PrunePods() []string

func (*PodManager) RemoveContainerFromPod added in v0.11.0

func (pm *PodManager) RemoveContainerFromPod(podID, containerIDOrName string) error

RemoveContainerFromPod removes a container from a pod by ID or name.

func (*PodManager) RemovePod

func (pm *PodManager) RemovePod(nameOrID string, force bool) error

func (*PodManager) RenamePod

func (pm *PodManager) RenamePod(nameOrID, newName string) error

func (*PodManager) RestartPod

func (pm *PodManager) RestartPod(nameOrID string) error

func (*PodManager) StartPod

func (pm *PodManager) StartPod(nameOrID string) error

func (*PodManager) StopPod

func (pm *PodManager) StopPod(nameOrID string) error

func (*PodManager) UnpausePod

func (pm *PodManager) UnpausePod(nameOrID string) error

type PodmanServer

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

func NewPodmanServer

func NewPodmanServer(root string, deps Deps) (*PodmanServer, error)

func (*PodmanServer) RegisterRoutes

func (s *PodmanServer) RegisterRoutes(mux *http.ServeMux)

type PortBinding

type PortBinding struct {
	HostIP   string `json:"host_ip,omitempty"`
	HostPort int    `json:"host_port"`
}

type Quadlet

type Quadlet struct {
	Name    string    `json:"name"`
	Type    string    `json:"type"`
	Path    string    `json:"path"`
	Status  string    `json:"status"`
	Created time.Time `json:"created"`
}

type Secret

type Secret struct {
	ID      string     `json:"ID"`
	Spec    SecretSpec `json:"Spec"`
	Created time.Time  `json:"CreatedAt"`
	Updated time.Time  `json:"UpdatedAt"`
}

type SecretManager

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

func NewSecretManager

func NewSecretManager(root string) (*SecretManager, error)

func (*SecretManager) Create

func (sm *SecretManager) Create(name string, data []byte, driver string, labels map[string]string) (*Secret, error)

func (*SecretManager) Exists

func (sm *SecretManager) Exists(nameOrID string) bool

func (*SecretManager) Get

func (sm *SecretManager) Get(nameOrID string) (*Secret, error)

func (*SecretManager) GetData

func (sm *SecretManager) GetData(nameOrID string) ([]byte, error)

func (*SecretManager) ListSecrets

func (sm *SecretManager) ListSecrets() []*Secret

func (*SecretManager) Remove

func (sm *SecretManager) Remove(nameOrID string) error

type SecretSpec

type SecretSpec struct {
	Name   string            `json:"Name"`
	Labels map[string]string `json:"Labels,omitempty"`
	Driver string            `json:"Driver,omitempty"`
}

type VolumeStore added in v0.12.0

type VolumeStore interface {
	Create(name string, driver string, opts map[string]string, labels map[string]string) (*common.VolumeInfo, error)
	Get(name string) (*common.VolumeInfo, error)
	List() []*common.VolumeInfo
	Remove(name string) error
	Prune(referencedVolumes map[string]bool) ([]string, error)
}

VolumeStore is the slice of the daemon's volume manager that the libpod surface needs. It is an interface rather than the concrete type because the manager lives in pkg/api, which imports this package.

Jump to

Keyboard shortcuts

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