runtime

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	ID() string
	Stop(ctx context.Context) error
}

Container is a running container handle.

type Mount

type Mount struct {
	Type   MountType
	Source string // volume name or host path
	Target string // path inside container
}

Mount is a container volume mount.

type MountType

type MountType string

MountType represents the type of a mount.

const (
	MountTypeBind   MountType = "bind"
	MountTypeVolume MountType = "volume"
)

type Port

type Port string

Port is a container port spec e.g. "80/tcp".

type PortBinding

type PortBinding struct {
	HostIP   netip.Addr
	HostPort string
}

PortBinding maps a container port to a host port.

type RunOptions

type RunOptions struct {
	Image        string
	Cmd          []string
	Env          map[string]string
	ExposedPorts []string // e.g. ["80/tcp"]
	PortBindings map[Port][]PortBinding
	Mounts       []Mount
	Labels       map[string]string
	PullImages   bool
	LogLine      func(stream, line string) // nil = no logging
}

RunOptions are the options for running a container.

type Runtime

type Runtime interface {
	Run(ctx context.Context, opts RunOptions) (Container, error)
	Close() error
}

Runtime launches and manages containers.

type RuntimeName

type RuntimeName string

RuntimeName identifies a container runtime backend.

const (
	RuntimeDocker     RuntimeName = "docker"
	RuntimeContainerd RuntimeName = "containerd"
)

Jump to

Keyboard shortcuts

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