containerd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package containerd provides a backend that executes code via containerd. Similar to Docker but more infrastructure-native for servers/agents already using containerd.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrContainerdNotAvailable is returned when containerd is not available.
	ErrContainerdNotAvailable = errors.New("containerd not available")

	// ErrImageNotFound is returned when the execution image is not found.
	ErrImageNotFound = errors.New("image not found")

	// ErrContainerFailed is returned when container creation/execution fails.
	ErrContainerFailed = errors.New("container execution failed")
)

Errors for containerd backend operations.

Functions

This section is empty.

Types

type Backend

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

Backend executes code via containerd with security isolation.

func New

func New(cfg Config) *Backend

New creates a new containerd backend with the given configuration.

func (*Backend) Execute

Execute runs code via containerd with security isolation.

func (*Backend) Kind

func (b *Backend) Kind() runtime.BackendKind

Kind returns the backend kind identifier.

type Config

type Config struct {
	// ImageRef is the image reference to use for execution.
	// Default: toolruntime-sandbox:latest
	ImageRef string

	// Namespace is the containerd namespace to use.
	// Default: default
	Namespace string

	// SocketPath is the path to the containerd socket.
	// Default: /run/containerd/containerd.sock
	SocketPath string

	// Logger is an optional logger for backend events.
	Logger Logger
}

Config configures a containerd backend.

type Logger

type Logger interface {
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

Logger is the interface for logging.

Contract: - Concurrency: implementations must be safe for concurrent use. - Errors: logging must be best-effort and must not panic.

Jump to

Keyboard shortcuts

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