engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedEngines           = []string{"podman", "docker"}
	SupportedPullImagePolicies = []string{"always", "missing", "never", "newer"}
)

Functions

This section is empty.

Types

type Container

type Container struct {
	ID  string
	Ref ContainerRef
}

type ContainerImage

type ContainerImage struct {
	Registry   string
	Repository string
	Name       string
	Tag        string
	Hash       string
}

type ContainerRef

type ContainerRef struct {
	Image           ContainerImage
	Tag             string
	Volumes         []VolumeMount
	Envs            map[string]string
	Tty             bool
	PublishAll      bool
	Interactive     bool
	Entrypoint      string
	Command         string
	BestEffortArgs  []string
	Privileged      bool
	RemoveAfterExit bool
	LocalPorts      map[string]int
}

type Engine

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

func New

func New(engine, pullPolicy string, dryRun bool) (*Engine, error)

func (*Engine) Attach

func (e *Engine) Attach(c *Container) error

Attach attaches to a container with the given id, replacing this process

func (*Engine) Copy

func (e *Engine) Copy(cpArgs ...string) (string, error)

Copy copies a source file to a destination (eg: podman cp)

func (*Engine) Create

func (e *Engine) Create(c ContainerRef) (*Container, error)

Exec creates a container with the given args, returning a *Container object

func (*Engine) Exec

func (e *Engine) Exec(c *Container, execArgs []string) (string, error)

Exec runs a command inside a running container (eg: podman exec)

func (*Engine) Inspect

func (e *Engine) Inspect(c *Container, value string) (string, error)

Inspect takes a string value as a formatter for inspect output (eg: podman inspect --format=)

func (*Engine) Start

func (e *Engine) Start(c *Container, attach bool) error

Start starts a given container (eg: podman start)

func (*Engine) Version

func (e *Engine) Version() error

Version returns the version of the container engine, replacing this process

type VolumeMount

type VolumeMount struct {
	Source       string
	Destination  string
	MountOptions string
}

Jump to

Keyboard shortcuts

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