containerapi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package containerapi reconciles runtime objects using exact ownership labels. A failed inspection is never evidence that an object is absent.

Index

Constants

View Source
const DockerSDK = "docker-api-v1"
View Source
const PodmanCLI = "podman-cli-v1"

Variables

This section is empty.

Functions

func CheckSelection

func CheckSelection(ctx context.Context, r Runtime, s Selection) error

func Identity

func Identity(ctx context.Context, runtime string) (string, error)

Identity pins both the daemon/store identity and the selected endpoint.

func IdentityAt

func IdentityAt(ctx context.Context, runtime string, ref *network.Reference) (string, error)

func Inspect

func Inspect(ctx context.Context, owner Owner) (id string, exists bool, err error)

func Output

func Output(ctx context.Context, runtime string, args ...string) ([]byte, error)

func OutputAt

func OutputAt(ctx context.Context, runtime string, ref *network.Reference, args ...string) ([]byte, error)

func Remove

func Remove(ctx context.Context, owner Owner) error

func ValidateImage

func ValidateImage(image Image) error

Types

type Attachment

type Attachment interface {
	Copy(Streams) error
	Close() error
}

Attachment must be acquired before Start. Copy drains the separated output streams and sends stdin EOF. Close interrupts blocked copies on cancellation.

type CreateRequest

type CreateRequest struct {
	Name, Image, User, WorkingDir string
	Entrypoint, Command, Env      []string
	Labels                        map[string]string
	Mounts                        []Mount
	Network                       string
	KeepID                        bool
	PrivatePaths                  []string
}

type ExecRequest

type ExecRequest struct {
	Command, Env     []string
	WorkingDir, User string
}

type ExecStatus

type ExecStatus struct {
	ID, ContainerID string
	Running         bool
	ExitCode        int
}

type Image

type Image struct {
	ID           string            `json:"id"`
	OS           string            `json:"os"`
	Architecture string            `json:"architecture"`
	Entrypoint   []string          `json:"entrypoint,omitempty"`
	Cmd          []string          `json:"cmd,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
}

type Mount

type Mount struct {
	Source, Target string
	ReadOnly       bool
}

type Object

type Object struct {
	ID, Name string
	Labels   map[string]string
	Running  bool
}

func VerifyOwned

func VerifyOwned(ctx context.Context, r Runtime, owner Owner) (Object, bool, error)

type Owner

type Owner struct {
	Selection *Selection         `json:"selection,omitempty"`
	Network   *network.Reference `json:"network_runtime,omitempty"`
	Runtime   string             `json:"runtime"`
	Identity  string             `json:"identity"`
	Name      string             `json:"name"`
	ID        string             `json:"id,omitempty"`
	Labels    map[string]string  `json:"labels"`
}

type Runtime

func Open

func Open(s Selection) (Runtime, error)

type Selection

type Selection struct {
	Transport   string   `json:"transport"`
	Endpoint    string   `json:"endpoint,omitempty"`
	Identity    string   `json:"identity"`
	Executable  string   `json:"executable,omitempty"`
	Environment []string `json:"environment,omitempty"`
}

Selection is retained with an invocation. Reopening never consults the current Docker context or environment. Daemon identity is checked before every launch and cleanup; a transport failure cannot prove absence.

func Resolve

func Resolve(ctx context.Context, name string, endpoint string) (Selection, error)

Resolve selects a local endpoint once. No image pull, login or daemon resource creation is performed. Podman's CLI environment is retained without credentials.

type Streams

type Streams struct {
	Stdin          io.Reader
	Stdout, Stderr io.Writer
}

Jump to

Keyboard shortcuts

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