engine

package
v0.0.0-...-8b1a8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagedLabel    = "dev.dproxy.managed"
	ProjectLabel    = "dev.dproxy.project"
	InvocationLabel = "dev.dproxy.invocation"
	RoleLabel       = "dev.dproxy.role"
	CommandRole     = "command"
	GatewayRole     = "gateway"
)
View Source
const MinimumAPIVersion = "1.40"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment interface {
	Wait() error
	Close() error
}

type ContainerID

type ContainerID string

type Docker

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

func NewDocker

func NewDocker(api any) *Docker

func (*Docker) ActiveDockerSubnets

func (d *Docker) ActiveDockerSubnets(ctx context.Context) ([]netip.Prefix, error)

func (*Docker) Attach

func (d *Docker) Attach(ctx context.Context, id string, streams IO) (Attachment, error)

func (*Docker) CreateNetwork

func (d *Docker) CreateNetwork(ctx context.Context, p policy.Plan) (Resource, error)

func (*Docker) GatewayHealth

func (d *Docker) GatewayHealth(ctx context.Context, r Resource, token string) error

func (*Docker) ListOwned

func (d *Docker) ListOwned(ctx context.Context, o Ownership) ([]Resource, error)

func (*Docker) PullByDigest

func (d *Docker) PullByDigest(ctx context.Context, ref string) error

func (*Docker) RemoveContainer

func (d *Docker) RemoveContainer(ctx context.Context, r Resource) error

func (*Docker) RemoveNetwork

func (d *Docker) RemoveNetwork(ctx context.Context, r Resource) error

func (*Docker) Resize

func (d *Docker) Resize(ctx context.Context, id ContainerID, height, width uint) error

func (*Docker) Signal

func (d *Docker) Signal(ctx context.Context, id string, s os.Signal) error

func (*Docker) StartCommand

func (d *Docker) StartCommand(ctx context.Context, p policy.Plan, networkID string, tty bool) (Resource, error)

func (*Docker) StartGateway

func (d *Docker) StartGateway(ctx context.Context, s GatewaySpec) (Resource, error)

func (*Docker) Verify

func (d *Docker) Verify(ctx context.Context) error

func (*Docker) Wait

func (d *Docker) Wait(ctx context.Context, id string) (int, error)

type Engine

type Engine interface {
	Verify(context.Context) error
	PullByDigest(context.Context, string) error
	CreateNetwork(context.Context, policy.Plan) (Resource, error)
	StartGateway(context.Context, GatewaySpec) (Resource, error)
	GatewayHealth(context.Context, Resource, string) error
	StartCommand(context.Context, policy.Plan, string, bool) (Resource, error)
	Attach(context.Context, string, IO) (Attachment, error)
	Wait(context.Context, string) (int, error)
	Resize(context.Context, ContainerID, uint, uint) error
	Signal(context.Context, string, os.Signal) error
	RemoveContainer(context.Context, Resource) error
	RemoveNetwork(context.Context, Resource) error
	ListOwned(context.Context, Ownership) ([]Resource, error)
}

Engine is the Docker-free execution boundary consumed by runtime and network policy.

type GatewaySpec

type GatewaySpec struct {
	Image, PolicyPath, HealthToken     string
	InternalNetworkID, EgressNetworkID string
	DNSUpstream                        string
	Ownership                          Ownership
	Ports                              []policy.Port
}

type IO

type IO struct {
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	TTY            bool
}

type Ownership

type Ownership struct {
	ProjectID, InvocationID string
}

type Resource

type Resource struct {
	ID        string
	Ownership Ownership
	Role      string
}

Jump to

Keyboard shortcuts

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