gvisorgvisor.dev/gvisor/pkg/shim/v1/extension Index | Files

package extension

import "gvisor.dev/gvisor/pkg/shim/v1/extension"

Package extension provides an extension to the shim.

Index

Variables

var NewExtension func(ctx context.Context, next TaskServiceExt, req *task.CreateTaskRequest) (TaskServiceExt, error)

NewExtension registers an extension constructor. It may return nil, nil to indicate that the extension should not handle this task request. Returning an error will fail the task request.

Types

type Process

type Process interface {
	process.Process
	// Restore restores the container from a snapshot.
	Restore(context.Context, *RestoreConfig) error
}

Process extends process.Process with extra restore functionality.

type RestoreConfig

type RestoreConfig struct {
	ImagePath  string
	Direct     bool
	Background bool
}

RestoreConfig is the configuration for a restore request.

type RestoreRequest

type RestoreRequest struct {
	Start task.StartRequest
	Conf  RestoreConfig
}

RestoreRequest is a request to restore a container. It extends task.StartRequest with restore functionality.

type TaskServiceExt

type TaskServiceExt interface {
	task.TaskService
	Cleanup(ctx context.Context) (*task.DeleteResponse, error)
	Restore(ctx context.Context, req *RestoreRequest) (*task.StartResponse, error)
}

TaskServiceExt extends TaskRequest with extra functionality required by the shim.

Source Files

extension.go

Version
v0.0.0-20250515015002-498360cc7c63 (latest)
Published
May 15, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
3 hours ago

Tools for package owners.