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

executor

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 483

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountStubsCleaner added in v0.8.0

func MountStubsCleaner(ctx context.Context, dir string, mounts []Mount, recursive bool) func()

func ValidContainerID added in v0.28.1

func ValidContainerID(id string) error

ValidContainerID validates that id is non-empty and contains only ASCII letters and digits.

Types

type Executor

type Executor interface {
	// Run will start a container for the given process with rootfs, mounts.
	// `id` is an optional name for the container so it can be referenced later via Exec.
	// `started` is an optional channel that will be closed when the container setup completes and has started running.
	Run(ctx context.Context, id string, rootfs Mount, mounts []Mount, process ProcessInfo, started chan<- struct{}) (resourcestypes.Recorder, error)
	// Exec will start a process in container matching `id`. An error will be returned
	// if the container failed to start (via Run) or has exited before Exec is called.
	Exec(ctx context.Context, id string, process ProcessInfo) error
}

type HostIP

type HostIP struct {
	Host string
	IP   net.IP
}

type Meta

type Meta struct {
	Args           []string
	Env            []string
	User           string
	Cwd            string
	Hostname       string
	Tty            bool
	ReadonlyRootFS bool
	ExtraHosts     []HostIP
	Ulimit         []*pb.Ulimit
	CDIDevices     []*pb.CDIDevice
	CgroupParent   string
	NetMode        pb.NetMode
	SecurityMode   pb.SecurityMode
	ValidExitCodes []int

	RemoveMountStubsRecursive bool
}

type Mount

type Mount struct {
	Src      Mountable
	Selector string
	Dest     string
	Readonly bool
}

type Mountable added in v0.8.0

type Mountable interface {
	Mount(ctx context.Context, readonly bool) (MountableRef, error)
}

type MountableRef added in v0.12.5

type MountableRef interface {
	Mount() ([]mount.Mount, func() error, error)
	IdentityMapping() *user.IdentityMapping
}

type ProcessInfo added in v0.8.0

type ProcessInfo struct {
	Meta           Meta
	Stdin          io.ReadCloser
	Stdout, Stderr io.WriteCloser
	Resize         <-chan WinSize
	Signal         <-chan syscall.Signal
}

type WinSize added in v0.8.0

type WinSize struct {
	Rows uint32
	Cols uint32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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