Documentation
¶
Index ¶
- func NewGoRuncEventHandler() runtime.EventHandler
- func NewWrappedConsoleSocket(ctx context.Context) (runtime.ConsoleSocket, error)
- func WrapWithRuntimeError(ctx context.Context, r *GoRuncRuntime, f func() error) error
- func WrapWithRuntimeErrorResult[T any](ctx context.Context, r *GoRuncRuntime, f func() (T, error)) (T, error)
- type CgroupV2Adapter
- type GoRuncEventHandler
- type GoRuncRuntime
- func (r *GoRuncRuntime) Checkpoint(ctx context.Context, id string, opts *gorunc.CheckpointOpts, ...) error
- func (r *GoRuncRuntime) Close(ctx context.Context) error
- func (r *GoRuncRuntime) Create(ctx context.Context, id, bundle string, options *gorunc.CreateOpts) error
- func (r *GoRuncRuntime) Delete(ctx context.Context, id string, opts *gorunc.DeleteOpts) error
- func (r *GoRuncRuntime) Events(ctx context.Context, id string, timeout time.Duration) (chan *gorunc.Event, error)
- func (r *GoRuncRuntime) Exec(ctx context.Context, id string, spec specs.Process, opts *gorunc.ExecOpts) error
- func (r *GoRuncRuntime) Kill(ctx context.Context, id string, signal int, opts *gorunc.KillOpts) error
- func (r *GoRuncRuntime) List(ctx context.Context) ([]*gorunc.Container, error)
- func (r *GoRuncRuntime) NewNullIO() (runtime.IO, error)
- func (r *GoRuncRuntime) NewPipeIO(ctx context.Context, cioUID, ioGID int, opts ...gorunc.IOOpt) (runtime.IO, error)
- func (r *GoRuncRuntime) NewTempConsoleSocket(ctx context.Context) (runtime.ConsoleSocket, error)
- func (r *GoRuncRuntime) Pause(ctx context.Context, id string) error
- func (r *GoRuncRuntime) Ps(ctx context.Context, id string) ([]int, error)
- func (r *GoRuncRuntime) ReadPidFile(ctx context.Context, path string) (int, error)
- func (r *GoRuncRuntime) Restore(ctx context.Context, id string, bundle string, opts *gorunc.RestoreOpts) (int, error)
- func (r *GoRuncRuntime) Resume(ctx context.Context, id string) error
- func (r *GoRuncRuntime) RuncRun(ctx context.Context, id, bundle string, options *gorunc.CreateOpts) (int, error)
- func (r *GoRuncRuntime) Start(ctx context.Context, id string) error
- func (r *GoRuncRuntime) State(ctx context.Context, id string) (*gorunc.Container, error)
- func (r *GoRuncRuntime) Stats(ctx context.Context, id string) (*gorunc.Stats, error)
- func (r *GoRuncRuntime) SubscribeToReaperExits(ctx context.Context) (<-chan gorunc.Exit, error)
- func (r *GoRuncRuntime) SubscribeToReaperExits2(ctx context.Context) (<-chan gorunc.Exit, error)
- func (r *GoRuncRuntime) Top(ctx context.Context, a string, b string) (*gorunc.TopResults, error)
- func (r *GoRuncRuntime) TryGetLastRuntimeError(ctx context.Context) string
- func (r *GoRuncRuntime) Update(ctx context.Context, id string, resources *specs.LinuxResources) error
- func (r *GoRuncRuntime) Version(ctx context.Context) (gorunc.Version, error)
- type GoRuncRuntimeCreator
- type MonitorWithSubscribers
- type ProcessMonitor
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
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) 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) 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) 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) ReadPidFile ¶
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) SubscribeToReaperExits ¶
func (*GoRuncRuntime) SubscribeToReaperExits2 ¶
func (*GoRuncRuntime) Top ¶
func (r *GoRuncRuntime) Top(ctx context.Context, a string, b string) (*gorunc.TopResults, error)
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.
type GoRuncRuntimeCreator ¶
type GoRuncRuntimeCreator struct {
}
func (*GoRuncRuntimeCreator) Create ¶
func (c *GoRuncRuntimeCreator) Create(ctx context.Context, opts *runtime.RuntimeOptions) (runtime.Runtime, error)
type MonitorWithSubscribers ¶
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).