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 ¶
- Variables
- func Load(file string) (sandbox.NodeConfig, error)
- func ValidateBinding(adapter Adapter, provider sandbox.SandboxProvider) error
- func ValidateRegistration(a Adapter) error
- type Adapter
- type Registry
- func (r *Registry) ArtifactCatalog() (map[string][]providerassets.Artifact, error)
- func (r *Registry) Build(config sandbox.NodeConfig, options sandbox.LocalOptions) (*sandbox.Built, func(), error)
- func (r *Registry) BuildDirect(c sandbox.DirectConfig) (sandbox.SandboxProvider, error)
- func (r *Registry) Decode(kind string, record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
- func (r *Registry) DecodeInput(kind string, public, credential json.RawMessage) (sandbox.Configuration, error)
- func (r *Registry) DeploymentContract() (python, typescript string, err error)
- func (r *Registry) Describe(kind, installation string) (sandbox.Description, error)
- func (r *Registry) DiscoverConfiguration(ctx context.Context, kind string, input sandbox.ConfigurationDiscoveryInput, ...) (sandbox.ConfigurationOptions, error)
- func (r *Registry) DiscoverSelection(ctx context.Context, c sandbox.DirectConfig) (sandbox.Selection, error)
- func (r *Registry) Encode(kind string, c sandbox.Configuration) (sandbox.ConfigurationRecord, error)
- func (r *Registry) Equal(kind string, a, b sandbox.Configuration) (bool, error)
- func (r *Registry) Lookup(kind string) (Adapter, error)
- func (r *Registry) Normalize(s sandbox.Selection) (sandbox.Selection, error)
- func (r *Registry) RequiresPublicOrigin(kind string) (bool, error)
- func (r *Registry) ResolveChange(next, previous sandbox.Selection) (sandbox.Selection, error)
- func (r *Registry) RetainedLimit(kind string, active, retained int) (int, error)
- func (r *Registry) SupportsCheckpoint(kind string) (bool, error)
- func (r *Registry) UsesCredential(kind string) (bool, error)
- func (r *Registry) ValidateSpecification(kind string, s sandbox.DeploymentSpec) error
- func (r *Registry) VerifyCredential(ctx context.Context, c sandbox.DirectConfig, refs []sandbox.Reference) error
- func (r *Registry) WithCredential(owner, candidate sandbox.Selection) (sandbox.Selection, error)
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownProvider = fmt.Errorf("%w: unsupported sandbox provider", sandbox.ErrInvalid)
ErrUnknownProvider reports a provider kind that no adapter registers.
Functions ¶
func Load ¶
func Load(file string) (sandbox.NodeConfig, error)
Load rejects unknown fields. The selected adapter decodes native at Build.
func ValidateBinding ¶
func ValidateBinding(adapter Adapter, provider sandbox.SandboxProvider) error
ValidateBinding catches construction that disagrees with its registration.
func ValidateRegistration ¶
ValidateRegistration checks wiring before configuration parsing or construction. Only configuration requirements, the setup declaration and operation declarations are read, and the policy only for a declared default size, after every other check.
Types ¶
type Adapter ¶
type Adapter struct {
NodeArtifacts []providerassets.Artifact
Policy sandbox.DeploymentPolicy
Setup sandbox.SetupDeclaration
Configuration sandbox.ConfigurationAdapter
BuildLocal func(sandbox.NodeConfig, sandbox.LocalOptions, *sandbox.Built) (func(), error)
BuildDirect func(sandbox.DirectConfig) (sandbox.SandboxProvider, error)
Mode sandbox.DeploymentMode
Operations func() providercontract.Operations
}
Adapter describes configuration and transport independently of compute operations. Native operation support comes from the adapter-owned complete declaration.
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 sandbox.NodeConfig, options sandbox.LocalOptions) (*sandbox.Built, func(), error)
Build validates the Core-owned part of a node configuration and passes it to the registered adapter. Local paths belong to the node; Core owns reservation capacity, execution resources and the immutable deployment release it enrolled with.
func (*Registry) BuildDirect ¶
func (r *Registry) BuildDirect(c sandbox.DirectConfig) (sandbox.SandboxProvider, error)
BuildDirect builds a direct-mode Provider and validates its binding.
func (*Registry) Decode ¶
func (r *Registry) Decode(kind string, record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
func (*Registry) DecodeInput ¶
func (r *Registry) DecodeInput(kind string, public, credential json.RawMessage) (sandbox.Configuration, error)
func (*Registry) DeploymentContract ¶ added in v0.0.10
DeploymentContract projects the registered modes, policies and setup declarations into the node installer and the TypeScript client; no second provider list exists in another language. At most one Provider per mode is recommended.
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) (sandbox.ConfigurationOptions, error)
func (*Registry) DiscoverSelection ¶ added in v0.0.10
func (r *Registry) DiscoverSelection(ctx context.Context, c sandbox.DirectConfig) (sandbox.Selection, error)
DiscoverSelection resolves a direct candidate's omitted native values.
func (*Registry) Encode ¶
func (r *Registry) Encode(kind string, c sandbox.Configuration) (sandbox.ConfigurationRecord, error)
func (*Registry) RequiresPublicOrigin ¶
func (*Registry) ResolveChange ¶
func (*Registry) RetainedLimit ¶
RetainedLimit keeps nodes without checkpoint support within their active capacity.
func (*Registry) SupportsCheckpoint ¶
SupportsCheckpoint reports whether the provider declares checkpoint suspension.
func (*Registry) ValidateSpecification ¶
func (r *Registry) ValidateSpecification(kind string, s sandbox.DeploymentSpec) error
func (*Registry) VerifyCredential ¶ added in v0.0.10
func (r *Registry) VerifyCredential(ctx context.Context, c sandbox.DirectConfig, refs []sandbox.Reference) error
VerifyCredential checks a candidate credential against owned resources.