Documentation
¶
Index ¶
- Constants
- func NewConsoleReferenceId() string
- func NewIoReferenceId() string
- func NewSocketReferenceId(allocatedSocket AllocatedSocket) string
- func NewUnixSocketReferenceId(path string) string
- func NewVsockSocketReferenceId(port uint32) string
- func ReflectNotImplementedError() error
- type AllocatedSocket
- type AllocatedSocketReference
- type AllocatedSocketWithUnixConn
- type BindableConsoleSocket
- type CgroupAdapter
- type CgroupEvent
- type ConsoleSocket
- type EventHandler
- type FileConn
- type GuestManagement
- type HostAllocatedStdio
- type HostNullIo
- type IO
- type Platform
- type PublishEvent
- type ReferableByReferenceId
- type Runtime
- type RuntimeConsole
- type RuntimeCreator
- type RuntimeExtras
- type RuntimeOptions
- type ServerStateGetter
- type ServerStateSetter
- type SocketAllocator
- type UnixAllocatedSocket
- type VsockAllocatedSocket
- type VsockFdProxier
- type VsockProxier
Constants ¶
View Source
const (
LogFileBase = "runc.log"
)
Variables ¶
This section is empty.
Functions ¶
func NewConsoleReferenceId ¶
func NewConsoleReferenceId() string
func NewIoReferenceId ¶
func NewIoReferenceId() string
func NewSocketReferenceId ¶
func NewSocketReferenceId(allocatedSocket AllocatedSocket) string
func ReflectNotImplementedError ¶
func ReflectNotImplementedError() error
Types ¶
type AllocatedSocket ¶
type AllocatedSocketReference ¶
type AllocatedSocketReference interface {
ReferableByReferenceId
}
type AllocatedSocketWithUnixConn ¶
type AllocatedSocketWithUnixConn interface {
AllocatedSocket
UnixConn() *net.UnixConn
}
type BindableConsoleSocket ¶
type BindableConsoleSocket interface {
ConsoleSocket
BindToAllocatedSocket(ctx context.Context, sock AllocatedSocket) error
}
type CgroupAdapter ¶
type CgroupEvent ¶
type ConsoleSocket ¶
type EventHandler ¶
type EventHandler interface {
Publish(ctx context.Context, event *PublishEvent) error
Receive(ctx context.Context) (<-chan *PublishEvent, error)
}
type GuestManagement ¶
type HostAllocatedStdio ¶
type HostAllocatedStdio struct {
StdinSocket AllocatedSocket
StdoutSocket AllocatedSocket
StderrSocket AllocatedSocket
ReferenceId string
// contains filtered or unexported fields
}
func NewHostAllocatedStdio ¶
func NewHostAllocatedStdio(ctx context.Context, referenceId string, stdinRef, stdoutRef, stderrRef AllocatedSocket, closeCallbacks ...func(ctx context.Context) error) *HostAllocatedStdio
func (*HostAllocatedStdio) Close ¶
func (p *HostAllocatedStdio) Close() error
func (*HostAllocatedStdio) GetReferenceId ¶
func (p *HostAllocatedStdio) GetReferenceId() string
func (*HostAllocatedStdio) Set ¶
func (p *HostAllocatedStdio) Set(cmd *exec.Cmd)
func (*HostAllocatedStdio) Stderr ¶
func (p *HostAllocatedStdio) Stderr() io.ReadCloser
func (*HostAllocatedStdio) Stdin ¶
func (p *HostAllocatedStdio) Stdin() io.WriteCloser
func (*HostAllocatedStdio) Stdout ¶
func (p *HostAllocatedStdio) Stdout() io.ReadCloser
type HostNullIo ¶
type HostNullIo struct {
IO
}
func NewHostNullIo ¶
func NewHostNullIo() (*HostNullIo, error)
type IO ¶
type IO interface {
Stdin() io.WriteCloser
Stdout() io.ReadCloser
Stderr() io.ReadCloser
Close() error
// unused
Set(cmd *exec.Cmd)
}
type Platform ¶
type Platform interface {
CopyConsole(ctx context.Context, console io.ReadWriteCloser, id, stdin, stdout, stderr string, wg *sync.WaitGroup) (cons RuntimeConsole, retErr error)
ShutdownConsole(ctx context.Context, console RuntimeConsole) error
Close() error
}
type PublishEvent ¶
type ReferableByReferenceId ¶
type ReferableByReferenceId interface {
GetReferenceId() string
}
type Runtime ¶
type Runtime interface {
// SharedDir() string
// io: yes
// ✅
NewPipeIO(ctx context.Context, cioUID, ioGID int, opts ...gorunc.IOOpt) (IO, error)
// io: yes
NewTempConsoleSocket(ctx context.Context) (ConsoleSocket, error)
// io: yes
// ✅
NewNullIO() (IO, error)
// io: yes
// console: yes
// channel: yes
// fd: yes
Create(ctx context.Context, id, bundle string, opts *gorunc.CreateOpts) error
// io: yes
// console: yes
// channel: yes
Exec(ctx context.Context, id string, spec specs.Process, opts *gorunc.ExecOpts) error
// fd: yes
Checkpoint(ctx context.Context, id string, opts *gorunc.CheckpointOpts, actions ...gorunc.CheckpointAction) error
// io: yes
Restore(ctx context.Context, id, bundle string, opts *gorunc.RestoreOpts) (int, error)
// ✅
Kill(ctx context.Context, id string, signal int, opts *gorunc.KillOpts) error
Start(ctx context.Context, id string) error
// ✅
Delete(ctx context.Context, id string, opts *gorunc.DeleteOpts) error
// ✅
Update(ctx context.Context, id string, resources *specs.LinuxResources) error
Pause(ctx context.Context, id string) error
Resume(ctx context.Context, id string) error
Ps(ctx context.Context, id string) ([]int, error)
ReadPidFile(ctx context.Context, path string) (int, error)
SubscribeToReaperExits(ctx context.Context) (<-chan gorunc.Exit, error)
State(context.Context, string) (*gorunc.Container, error)
RuncRun(context.Context, string, string, *gorunc.CreateOpts) (int, error)
Close(ctx context.Context) error
}
type RuntimeConsole ¶
type RuntimeConsole interface {
console.File
// Resize resizes the console to the provided window size
Resize(console.WinSize) error
// ResizeFrom resizes the calling console to the size of the
// provided console
ResizeFrom(RuntimeConsole) error
// SetRaw sets the console in raw mode
SetRaw() error
// DisableEcho disables echo on the console
DisableEcho() error
// Reset restores the console to its original state
Reset() error
// Size returns the window size of the console
Size() (console.WinSize, error)
}
type RuntimeCreator ¶
type RuntimeExtras ¶
type RuntimeExtras interface {
// Stats returns runtime specific metrics for a container.
Stats(context.Context, string) (*gorunc.Stats, error)
// Events returns events for the container.
Events(context.Context, string, time.Duration) (chan *gorunc.Event, error)
// List lists all containers.
List(context.Context) ([]*gorunc.Container, error)
// Version returns the version of runc.
Version(context.Context) (gorunc.Version, error)
Top(context.Context, string, string) (*gorunc.TopResults, error)
}
RuncLibrary defines an interface for interacting with runc containers. This interface mirrors the functionality provided by the go-runc package to allow for easy mocking and testing.
type RuntimeOptions ¶
type ServerStateGetter ¶
type ServerStateGetter interface {
GetOpenIO(referenceId string) (IO, bool)
GetOpenVsockConnection(port uint32) (VsockAllocatedSocket, bool)
GetOpenUnixConnection(path string) (UnixAllocatedSocket, bool)
GetOpenConsole(referenceId string) (ConsoleSocket, bool)
}
type ServerStateSetter ¶
type ServerStateSetter interface {
StoreOpenIO(referenceId string, io IO)
StoreOpenSocket(referenceId string, socket AllocatedSocket)
StoreOpenConsole(referenceId string, console ConsoleSocket)
}
type SocketAllocator ¶
type SocketAllocator interface {
AllocateSocket(ctx context.Context) (AllocatedSocket, error)
}
type UnixAllocatedSocket ¶
type UnixAllocatedSocket interface {
AllocatedSocket
Path() string
}
type VsockAllocatedSocket ¶
type VsockAllocatedSocket interface {
AllocatedSocket
Port() uint32
}
type VsockFdProxier ¶
Click to show internal directories.
Click to hide internal directories.