providers

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Node-local adapter configuration and construction.

Package providers is the explicit registration boundary for sandbox adapters. It performs read-only configuration work; it never allocates compute.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownProvider = fmt.Errorf("%w: unsupported sandbox provider", sandbox.ErrInvalid)

ErrUnknownProvider reports a provider kind that no adapter registers.

Functions

func BackendFingerprint

func BackendFingerprint(kind, namespace string) string

func ValidateBinding

func ValidateBinding(adapter Adapter, provider sandbox.SandboxProvider) error

ValidateBinding catches construction that disagrees with its registration.

func ValidateRegistration

func ValidateRegistration(a Adapter) error

ValidateRegistration checks wiring before configuration parsing or construction. Only configuration requirements and operation declarations are read.

Types

type Adapter

type Adapter struct {
	NodeArtifacts                 []providerassets.Artifact
	Policy                        sandbox.DeploymentPolicy
	Configuration                 sandbox.ConfigurationAdapter
	BuildLocal                    func(Config, LocalOptions, *Built) (func(), error)
	BuildDirect                   func(DirectConfig) (sandbox.SandboxProvider, error)
	Mode                          string
	Operations                    func() providercontract.Operations
	IdleSeconds, RetentionSeconds int64
	ValidateSpecification         func(sandbox.DeploymentSpec) error
	ValidateResources             func(sandbox.Resources) error
}

Adapter describes configuration and transport independently of compute operations. Native operation support comes from the adapter-owned complete declaration.

type Built

type Built struct {
	SpecificationDigest                string
	Provider                           sandbox.SandboxProvider
	InstallationID, BackendFingerprint string
	Probe                              func(context.Context) error
}

type Config

type Config struct {
	Specification  sandbox.DeploymentSpec `json:"specification"`
	Generation     uint64                 `json:"generation"`
	CoreURL        string                 `json:"core_url"`
	Provider       string                 `json:"provider"`
	InstallationID string                 `json:"installation_id"`
	Docker         *Docker                `json:"docker,omitempty"`
	Microsandbox   *Microsandbox          `json:"microsandbox,omitempty"`
}

func Load

func Load(file string) (Config, error)

Load rejects unknown fields, mixed adapters and explicit null configuration.

type DirectConfig

type DirectConfig struct {
	ProcessPaths   sandbox.ProcessPaths
	InstallationID string
	Selection      sandbox.Selection
	Fence          *sandbox.CallFence
}

type Docker

type Docker struct {
	Host          string   `json:"host"`
	Image         string   `json:"image"`
	Network       string   `json:"network"`
	SeccompFile   string   `json:"seccomp_file"`
	ExtraHosts    []string `json:"extra_hosts"`
	NestedSandbox bool     `json:"nested_sandbox"`
}

type LocalOptions

type LocalOptions struct {
	// Standalone selects registration or execution without a generation manager.
	Standalone bool
	// GenerationStateDirectory is the node state directory when constructing a
	// retained generation. It must be canonical and absolute, and Standalone
	// must be false.
	GenerationStateDirectory string
}

LocalOptions supplies process-local context without changing persisted configuration.

type Microsandbox

type Microsandbox struct {
	HelperPath         string  `json:"helper_path"`
	RuntimeHome        string  `json:"runtime_home"`
	RuntimePath        string  `json:"runtime_path"`
	FirmwarePath       string  `json:"firmware_path"`
	RuntimeSHA256      string  `json:"runtime_sha256"`
	FirmwareSHA256     string  `json:"firmware_sha256"`
	Image              string  `json:"image"`
	MemoryMiB          uint32  `json:"memory_mib"`
	CPUs               uint8   `json:"cpus"`
	RootDiskMiB        uint32  `json:"root_disk_mib"`
	EnvironmentDiskMiB uint32  `json:"environment_disk_mib"`
	Network            Network `json:"network"`
}

Single-host providers pin the helper, runtime, firmware, image and resource limits explicitly. The helper owns local paths; no ambient backend is selected.

type Network

type Network struct {
	DefaultEgress  string `json:"default_egress"`
	DefaultIngress string `json:"default_ingress"`
	Rules          []Rule `json:"rules"`
}

type Registry

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

Registry holds the registered adapters. Core and the node program each build one with Builtin and pass it explicitly; there is no package-level lookup.

func Builtin

func Builtin() *Registry

Builtin returns a registry of the adapters built into this program.

func (*Registry) ArtifactCatalog

func (r *Registry) ArtifactCatalog() (map[string][]providerassets.Artifact, error)

ArtifactCatalog projects registered node requirements for Web and installers.

func (*Registry) Build

func (r *Registry) Build(config Config, options LocalOptions) (*Built, func(), error)

func (*Registry) BuildDirect

func (r *Registry) BuildDirect(c DirectConfig) (sandbox.SandboxProvider, error)

func (*Registry) Decode

func (*Registry) DecodeInput

func (r *Registry) DecodeInput(kind string, public, credential json.RawMessage) (sandbox.Configuration, error)

func (*Registry) Describe

func (r *Registry) Describe(kind, installation string) (sandbox.Description, error)

Describe derives the description once for both preview and persistence. Its fingerprint identifies a namespace, never mutable capacity or a credential.

func (*Registry) DiscoverConfiguration

func (r *Registry) DiscoverConfiguration(ctx context.Context, kind string, input sandbox.ConfigurationDiscoveryInput, paths sandbox.ProcessPaths) (json.RawMessage, error)

func (*Registry) Encode

func (*Registry) Equal

func (r *Registry) Equal(kind string, a, b sandbox.Configuration) (bool, error)

func (*Registry) IsNode

func (r *Registry) IsNode(kind string) (bool, error)

IsNode reports whether the provider runs on enrolled sandbox nodes.

func (*Registry) Lookup

func (r *Registry) Lookup(kind string) (Adapter, error)

Lookup returns a registered adapter after validating its registration.

func (*Registry) Normalize

func (r *Registry) Normalize(s sandbox.Selection) (sandbox.Selection, error)

func (*Registry) PythonDeploymentContract

func (r *Registry) PythonDeploymentContract() (string, error)

PythonDeploymentContract projects the same registered adapter policies into the node installer; no second provider list exists in another language.

func (*Registry) RequiresPublicOrigin

func (r *Registry) RequiresPublicOrigin(kind string) (bool, error)

func (*Registry) ResolveChange

func (r *Registry) ResolveChange(next, previous sandbox.Selection) (sandbox.Selection, error)

func (*Registry) RetainedLimit

func (r *Registry) RetainedLimit(kind string, active, retained int) (int, error)

RetainedLimit keeps nodes without checkpoint support within their active capacity.

func (*Registry) SupportsCheckpoint

func (r *Registry) SupportsCheckpoint(kind string) (bool, error)

SupportsCheckpoint reports whether the provider declares checkpoint suspension.

func (*Registry) UsesCredential

func (r *Registry) UsesCredential(kind string) (bool, error)

func (*Registry) ValidateResources

func (r *Registry) ValidateResources(kind string, s sandbox.Resources) error

func (*Registry) ValidateSpecification

func (r *Registry) ValidateSpecification(kind string, s sandbox.DeploymentSpec) error

func (*Registry) WithCredential

func (r *Registry) WithCredential(owner, candidate sandbox.Selection) (sandbox.Selection, error)

type Rule

type Rule struct {
	Action      string `json:"action"`
	Direction   string `json:"direction"`
	Destination string `json:"destination"`
	Protocol    string `json:"protocol"`
	Port        string `json:"port"`
}

Jump to

Keyboard shortcuts

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