runtime

package
v0.0.0-...-70db0ab Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MountTypeBind   = "bind"
	MountTypeVolume = "volume"
	MountTypeTmpfs  = "tmpfs"
)
View Source
const (
	DetachKeys = "ctrl-d"
)
View Source
const (
	MountOptReadOnly = "ro"
)

Variables

View Source
var File_runtime_exec_proto protoreflect.FileDescriptor
View Source
var File_runtime_mount_proto protoreflect.FileDescriptor
View Source
var File_runtime_spec_proto protoreflect.FileDescriptor
View Source
var NetworkMounts = []*Mount{
	{
		Source:      crtsDir,
		Destination: crtsDir,
		Type:        MountTypeBind,
		Options:     []string{MountOptReadOnly},
	},
	{
		Source:      hostsFile,
		Destination: hostsFile,
		Type:        MountTypeBind,
		Options:     []string{MountOptReadOnly},
	},
	{
		Source:      resolveConf,
		Destination: resolveConf,
		Type:        MountTypeBind,
		Options:     []string{MountOptReadOnly},
	},
}
View Source
var StreamsStdio = NewStreams(os.Stdin, os.Stdout, os.Stderr)

Functions

This section is empty.

Types

type Container

type Container interface {
	GetID() string
	Exec(context.Context, *Exec, *Streams) error
	CopyTo(context.Context, io.Reader, string) error
	CopyFrom(context.Context, string) (io.ReadCloser, error)
	Stop(context.Context) error
	Remove(context.Context) error
	Start(context.Context) error
	Attach(context.Context, *Streams) error
}

type Exec

type Exec struct {
	Cmd []string `protobuf:"bytes,1,rep,name=cmd,proto3" json:"cmd,omitempty"`
	// contains filtered or unexported fields
}

func (*Exec) Descriptor deprecated

func (*Exec) Descriptor() ([]byte, []int)

Deprecated: Use Exec.ProtoReflect.Descriptor instead.

func (*Exec) GetCmd

func (x *Exec) GetCmd() []string

func (*Exec) ProtoMessage

func (*Exec) ProtoMessage()

func (*Exec) ProtoReflect

func (x *Exec) ProtoReflect() protoreflect.Message

func (*Exec) Reset

func (x *Exec) Reset()

func (*Exec) String

func (x *Exec) String() string

type Image

type Image interface {
	GetRef() string
}

type Mount

type Mount struct {
	Source      string   `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
	Destination string   `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
	Type        string   `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	Options     []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*Mount) Descriptor deprecated

func (*Mount) Descriptor() ([]byte, []int)

Deprecated: Use Mount.ProtoReflect.Descriptor instead.

func (*Mount) GetDestination

func (x *Mount) GetDestination() string

func (*Mount) GetOptions

func (x *Mount) GetOptions() []string

func (*Mount) GetSource

func (x *Mount) GetSource() string

func (*Mount) GetType

func (x *Mount) GetType() string

func (*Mount) ProtoMessage

func (*Mount) ProtoMessage()

func (*Mount) ProtoReflect

func (x *Mount) ProtoReflect() protoreflect.Message

func (*Mount) Reset

func (x *Mount) Reset()

func (*Mount) String

func (x *Mount) String() string

type Runtime

type Runtime interface {
	PullImage(context.Context, string) (Image, error)
	PruneImages(context.Context) error

	CreateContainer(context.Context, *Spec) (Container, error)
	GetContainer(context.Context, string) (Container, error)
	PruneContainers(context.Context) error

	CreateVolume(context.Context, string) (Volume, error)
	GetVolume(context.Context, string) (Volume, error)
	PruneVolumes(context.Context) error
}

type Spec

type Spec struct {
	Image      string   `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
	Entrypoint []string `protobuf:"bytes,2,rep,name=entrypoint,proto3" json:"entrypoint,omitempty"`
	Cmd        []string `protobuf:"bytes,3,rep,name=cmd,proto3" json:"cmd,omitempty"`
	Cwd        string   `protobuf:"bytes,4,opt,name=cwd,proto3" json:"cwd,omitempty"`
	Env        []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env,omitempty"`
	Mounts     []*Mount `protobuf:"bytes,6,rep,name=mounts,proto3" json:"mounts,omitempty"`
	Privileged bool     `protobuf:"varint,7,opt,name=privileged,proto3" json:"privileged,omitempty"`
	// contains filtered or unexported fields
}

func (*Spec) Descriptor deprecated

func (*Spec) Descriptor() ([]byte, []int)

Deprecated: Use Spec.ProtoReflect.Descriptor instead.

func (*Spec) GetCmd

func (x *Spec) GetCmd() []string

func (*Spec) GetCwd

func (x *Spec) GetCwd() string

func (*Spec) GetEntrypoint

func (x *Spec) GetEntrypoint() []string

func (*Spec) GetEnv

func (x *Spec) GetEnv() []string

func (*Spec) GetImage

func (x *Spec) GetImage() string

func (*Spec) GetMounts

func (x *Spec) GetMounts() []*Mount

func (*Spec) GetPrivileged

func (x *Spec) GetPrivileged() bool

func (*Spec) ProtoMessage

func (*Spec) ProtoMessage()

func (*Spec) ProtoReflect

func (x *Spec) ProtoReflect() protoreflect.Message

func (*Spec) Reset

func (x *Spec) Reset()

func (*Spec) String

func (x *Spec) String() string

type Streams

type Streams struct {
	In         io.Reader
	Out        io.Writer
	Err        io.Writer
	DetachKeys string
}

func NewStreams

func NewStreams(stdin io.Reader, stdout, stderr io.Writer) *Streams

type Volume

type Volume interface {
	GetSource() string
	Remove(context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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