goruncruntime

package
v0.0.0-...-39278d5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoRuncEventHandler

func NewGoRuncEventHandler() runtime.EventHandler

func NewWrappedConsoleSocket

func NewWrappedConsoleSocket(ctx context.Context) (runtime.ConsoleSocket, error)

func WrapWithRuntimeError

func WrapWithRuntimeError(ctx context.Context, r *GoRuncRuntime, f func() error) error

func WrapWithRuntimeErrorResult

func WrapWithRuntimeErrorResult[T any](ctx context.Context, r *GoRuncRuntime, f func() (T, error)) (T, error)

Types

type CgroupV2Adapter

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

func NewCgroupV2Adapter

func NewCgroupV2Adapter(ctx context.Context, containerId string) (*CgroupV2Adapter, error)

func (*CgroupV2Adapter) OpenEventChan

func (me *CgroupV2Adapter) OpenEventChan(ctx context.Context) (<-chan *runmv1.CgroupEvent, <-chan error, error)

OpenEventChan implements runtime.CgroupAdapter.

func (*CgroupV2Adapter) Stat

func (a *CgroupV2Adapter) Stat(ctx context.Context) (*stats.Metrics, error)

func (*CgroupV2Adapter) ToggleControllers

func (me *CgroupV2Adapter) ToggleControllers(ctx context.Context) error

type GoRuncEventHandler

type GoRuncEventHandler struct {
}

func (*GoRuncEventHandler) Publish

func (r *GoRuncEventHandler) Publish(ctx context.Context, event *runtime.PublishEvent) error

Publish implements runtime.EventHandler.

func (*GoRuncEventHandler) Receive

func (r *GoRuncEventHandler) Receive(ctx context.Context) (<-chan *runtime.PublishEvent, error)

Receive implements runtime.EventHandler.

type GoRuncRuntime

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

func WrapdGoRuncRuntime

func WrapdGoRuncRuntime(rt *gorunc.Runc) *GoRuncRuntime

func (*GoRuncRuntime) Checkpoint

func (r *GoRuncRuntime) Checkpoint(ctx context.Context, id string, opts *gorunc.CheckpointOpts, actions ...gorunc.CheckpointAction) error

func (*GoRuncRuntime) Close

func (r *GoRuncRuntime) Close(ctx context.Context) error

func (*GoRuncRuntime) Create

func (r *GoRuncRuntime) Create(ctx context.Context, id, bundle string, options *gorunc.CreateOpts) error

func (*GoRuncRuntime) Delete

func (r *GoRuncRuntime) Delete(ctx context.Context, id string, opts *gorunc.DeleteOpts) error

Delete implements runtime.Runtime.

func (*GoRuncRuntime) Events

func (r *GoRuncRuntime) Events(ctx context.Context, id string, timeout time.Duration) (chan *gorunc.Event, error)

Events implements runtime.RuntimeExtras.

func (*GoRuncRuntime) Exec

func (r *GoRuncRuntime) Exec(ctx context.Context, id string, spec specs.Process, opts *gorunc.ExecOpts) error

Exec implements runtime.Runtime.

func (*GoRuncRuntime) Kill

func (r *GoRuncRuntime) Kill(ctx context.Context, id string, signal int, opts *gorunc.KillOpts) error

Kill implements runtime.Runtime.

func (*GoRuncRuntime) List

func (r *GoRuncRuntime) List(ctx context.Context) ([]*gorunc.Container, error)

List implements runtime.RuntimeExtras.

func (*GoRuncRuntime) NewNullIO

func (r *GoRuncRuntime) NewNullIO() (runtime.IO, error)

func (*GoRuncRuntime) NewPipeIO

func (r *GoRuncRuntime) NewPipeIO(ctx context.Context, cioUID, ioGID int, opts ...gorunc.IOOpt) (runtime.IO, error)

func (*GoRuncRuntime) NewTempConsoleSocket

func (r *GoRuncRuntime) NewTempConsoleSocket(ctx context.Context) (runtime.ConsoleSocket, error)

func (*GoRuncRuntime) Pause

func (r *GoRuncRuntime) Pause(ctx context.Context, id string) error

Pause implements runtime.Runtime.

func (*GoRuncRuntime) Ps

func (r *GoRuncRuntime) Ps(ctx context.Context, id string) ([]int, error)

Ps implements runtime.Runtime.

func (*GoRuncRuntime) ReadPidFile

func (r *GoRuncRuntime) ReadPidFile(ctx context.Context, path string) (int, error)

func (*GoRuncRuntime) Restore

func (r *GoRuncRuntime) Restore(ctx context.Context, id string, bundle string, opts *gorunc.RestoreOpts) (int, error)

Restore implements runtime.Runtime.

func (*GoRuncRuntime) Resume

func (r *GoRuncRuntime) Resume(ctx context.Context, id string) error

Resume implements runtime.Runtime.

func (*GoRuncRuntime) RuncRun

func (r *GoRuncRuntime) RuncRun(ctx context.Context, id, bundle string, options *gorunc.CreateOpts) (int, error)

func (*GoRuncRuntime) Start

func (r *GoRuncRuntime) Start(ctx context.Context, id string) error

start

func (*GoRuncRuntime) State

func (r *GoRuncRuntime) State(ctx context.Context, id string) (*gorunc.Container, error)

State implements runtime.RuntimeExtras.

func (*GoRuncRuntime) Stats

func (r *GoRuncRuntime) Stats(ctx context.Context, id string) (*gorunc.Stats, error)

Stats implements runtime.RuntimeExtras.

func (*GoRuncRuntime) SubscribeToReaperExits

func (r *GoRuncRuntime) SubscribeToReaperExits(ctx context.Context) (<-chan gorunc.Exit, error)

func (*GoRuncRuntime) SubscribeToReaperExits2

func (r *GoRuncRuntime) SubscribeToReaperExits2(ctx context.Context) (<-chan gorunc.Exit, error)

func (*GoRuncRuntime) Top

Top implements runtime.RuntimeExtras.

func (*GoRuncRuntime) TryGetLastRuntimeError

func (r *GoRuncRuntime) TryGetLastRuntimeError(ctx context.Context) string

func (*GoRuncRuntime) Update

func (r *GoRuncRuntime) Update(ctx context.Context, id string, resources *specs.LinuxResources) error

Update implements runtime.Runtime.

func (*GoRuncRuntime) Version

func (r *GoRuncRuntime) Version(ctx context.Context) (gorunc.Version, error)

Version implements runtime.RuntimeExtras.

type GoRuncRuntimeCreator

type GoRuncRuntimeCreator struct {
}

func (*GoRuncRuntimeCreator) Create

func (*GoRuncRuntimeCreator) Features

Features implements runtime.RuntimeCreator.

type MonitorWithSubscribers

type MonitorWithSubscribers interface {
	gorunc.ProcessMonitor
	Subscribe(ctx context.Context) chan gorunc.Exit
	Unsubscribe(ctx context.Context, ch chan gorunc.Exit)
}

type ProcessMonitor

type ProcessMonitor interface {
	Start(*exec.Cmd) (chan gorunc.Exit, error)
	StartLocked(*exec.Cmd) (chan gorunc.Exit, error)
	Wait(*exec.Cmd, chan gorunc.Exit) (int, error)
}

ProcessMonitor is an interface for process monitoring.

It allows daemons using go-runc to have a SIGCHLD handler to handle exits without introducing races between the handler and go's exec.Cmd.

ProcessMonitor also provides a StartLocked method which is similar to Start, but locks the goroutine used to start the process to an OS thread (for example: when Pdeathsig is set).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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