Documentation
¶
Overview ¶
Package node implements NodeSandboxControl, which wraps our sandbox-host RPC service to satisfy the SandboxControl interface.
Index ¶
- type NodeSandboxControl
- func (n *NodeSandboxControl) Capabilities() control.SandboxCapabilities
- func (n *NodeSandboxControl) CreateSandbox(ctx context.Context, req control.CreateSandboxRequest) (*control.CreateSandboxResponse, error)
- func (n *NodeSandboxControl) DestroySandbox(ctx context.Context, sandboxID string) error
- func (n *NodeSandboxControl) GetProcessStatus(ctx context.Context, req control.GetProcessStatusRequest) (*control.GetProcessStatusResponse, error)
- func (n *NodeSandboxControl) KillProcess(ctx context.Context, req control.KillProcessRequest) error
- func (n *NodeSandboxControl) LaunchProcess(ctx context.Context, req control.LaunchProcessRequest) (*control.LaunchProcessResponse, error)
- func (n *NodeSandboxControl) PauseSandbox(ctx context.Context, sandboxID string) error
- func (n *NodeSandboxControl) ResumeSandbox(ctx context.Context, sandboxID string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeSandboxControl ¶
type NodeSandboxControl struct {
// contains filtered or unexported fields
}
NodeSandboxControl wraps a sandbox-host RPC client to provide SandboxControl for node (on-premise gVisor + ZFS) sandboxes.
func NewNodeSandboxControl ¶
func NewNodeSandboxControl(client api.SandboxService, opts ...Option) *NodeSandboxControl
NewNodeSandboxControl creates a NodeSandboxControl wrapping the given sandbox-host RPC client.
func (*NodeSandboxControl) Capabilities ¶
func (n *NodeSandboxControl) Capabilities() control.SandboxCapabilities
Capabilities returns the node sandbox provider capabilities.
func (*NodeSandboxControl) CreateSandbox ¶
func (n *NodeSandboxControl) CreateSandbox(ctx context.Context, req control.CreateSandboxRequest) (*control.CreateSandboxResponse, error)
CreateSandbox provisions a new sandbox by calling CreateSession on the sandbox-host. Field mapping:
- Template -> BaseSnapshot
- Labels -> Labels
- Resources -> logged (resource limits set at sandbox-host level)
func (*NodeSandboxControl) DestroySandbox ¶
func (n *NodeSandboxControl) DestroySandbox(ctx context.Context, sandboxID string) error
DestroySandbox tears down a sandbox by calling DestroySession.
func (*NodeSandboxControl) GetProcessStatus ¶
func (n *NodeSandboxControl) GetProcessStatus(ctx context.Context, req control.GetProcessStatusRequest) (*control.GetProcessStatusResponse, error)
GetProcessStatus queries the status of a launched process.
func (*NodeSandboxControl) KillProcess ¶
func (n *NodeSandboxControl) KillProcess(ctx context.Context, req control.KillProcessRequest) error
KillProcess sends a signal to a running process via the sandbox-host.
func (*NodeSandboxControl) LaunchProcess ¶
func (n *NodeSandboxControl) LaunchProcess(ctx context.Context, req control.LaunchProcessRequest) (*control.LaunchProcessResponse, error)
LaunchProcess starts a long-running process inside the sandbox by calling the sandbox-host LaunchProcess RPC.
func (*NodeSandboxControl) PauseSandbox ¶
func (n *NodeSandboxControl) PauseSandbox(ctx context.Context, sandboxID string) error
PauseSandbox pauses a sandbox by calling PauseSession.
func (*NodeSandboxControl) ResumeSandbox ¶
func (n *NodeSandboxControl) ResumeSandbox(ctx context.Context, sandboxID string) error
ResumeSandbox resumes a paused sandbox by calling ResumeSession.
type Option ¶
type Option func(*NodeSandboxControl)
Option configures a NodeSandboxControl.
func WithDefaultQuota ¶
WithDefaultQuota sets the default disk quota (bytes) for new sandboxes.
func WithLogger ¶
WithLogger sets the structured logger.