docker

package
v0.0.0-...-611bec0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelProject = "dev.ocel.project"
	LabelBackend = "dev.ocel.backend"
)
View Source
const (
	StopsWithin = stopGrace + 3*time.Second
)

Variables

This section is empty.

Functions

func Labels

func Labels(project, backend string) map[string]string

func Name

func Name(project string, parts ...string) string

func ProjectLabels

func ProjectLabels(project string) map[string]string

func WaitReady

func WaitReady(ctx context.Context, engine Engine, id string, within time.Duration, probe func(context.Context) error) error

Types

type Container

type Container struct {
	ID      string
	Address string
}

type Engine

type Engine interface {
	Run(ctx context.Context, spec Spec) (Container, error)
	ReadExit(ctx context.Context, id string) (*Exited, error)
	Exec(ctx context.Context, id string, argv ...string) (string, error)
	ExecInput(ctx context.Context, id, input string, argv ...string) (string, error)
	Stop(ctx context.Context, id string) error
	Wipe(ctx context.Context, labels map[string]string) error
	Close() error
}

func Open

func Open(ctx context.Context) (Engine, error)

type ExecFailed

type ExecFailed struct {
	Argv   []string
	Code   int
	Output string
}

func (*ExecFailed) Error

func (e *ExecFailed) Error() string

type Exited

type Exited struct {
	Container string
	Code      int
	OOMKilled bool
	Removed   bool
	Logs      string
}

func (*Exited) Error

func (e *Exited) Error() string

type OpenFunc

type OpenFunc func(ctx context.Context) (Engine, error)

type Spec

type Spec struct {
	Name       string
	Image      string
	Args       []string
	User       string
	Env        []string
	Port       int
	Volume     string
	VolumePath string
	Labels     map[string]string
}

type Unreachable

type Unreachable struct {
	Address string
	For     string
	Err     error
}

func (*Unreachable) Error

func (u *Unreachable) Error() string

func (*Unreachable) Unwrap

func (u *Unreachable) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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