Documentation
¶
Overview ¶
Package opensandbox runs Core-managed sandboxes on an operator's OpenSandbox server through its official Go SDK. Sandboxes are found by their ownership metadata, so the adapter keeps no receipts or state of its own.
Index ¶
- func BuildDirect(c sandbox.DirectConfig) (sandbox.SandboxProvider, error)
- func Operations() providercontract.Operations
- func Policy() sandbox.DeploymentPolicy
- func Setup() sandbox.SetupDeclaration
- type ConfigurationAdapter
- func (ConfigurationAdapter) Decode(record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
- func (ConfigurationAdapter) DecodeInput(public, secret json.RawMessage) (sandbox.Configuration, error)
- func (ConfigurationAdapter) DiscoverConfiguration(context.Context, sandbox.ConfigurationDiscoveryInput, sandbox.ProcessPaths) (sandbox.ConfigurationOptions, error)
- func (ConfigurationAdapter) DiscoverSelection(context.Context, sandbox.DirectConfig) (sandbox.Selection, error)
- func (ConfigurationAdapter) Encode(value sandbox.Configuration) (sandbox.ConfigurationRecord, error)
- func (ConfigurationAdapter) Equal(a, b sandbox.Configuration) (bool, error)
- func (ConfigurationAdapter) Normalize(s sandbox.Selection) (sandbox.Selection, error)
- func (ConfigurationAdapter) Requirements() sandbox.ConfigurationRequirements
- func (a ConfigurationAdapter) ResolveChange(next, previous sandbox.Selection) (sandbox.Selection, error)
- func (ConfigurationAdapter) VerifyCredential(ctx context.Context, c sandbox.DirectConfig, refs []sandbox.Reference) error
- func (ConfigurationAdapter) WithCredential(owner, candidate sandbox.Configuration) (sandbox.Configuration, error)
- type DeploymentConfiguration
- type Provider
- func (p *Provider) Create(ctx context.Context, b sandbox.Bootstrap) (sandbox.Info, error)
- func (*Provider) DeleteSnapshot(context.Context, sandbox.Reference, sandbox.SnapshotIdentity) error
- func (*Provider) GetCompute(context.Context, sandbox.Reference, sandbox.Compute) (sandbox.ComputeState, error)
- func (p *Provider) GetInfo(ctx context.Context, r sandbox.Reference) (sandbox.Info, error)
- func (*Provider) Initial(context.Context, sandbox.Reference) (sandbox.Compute, error)
- func (p *Provider) Kill(ctx context.Context, r sandbox.Reference) error
- func (*Provider) KillCompute(context.Context, sandbox.Reference, sandbox.Compute) error
- func (*Provider) NewCompute(context.Context, sandbox.Reference, uint64, *sandbox.SnapshotIdentity) (sandbox.Compute, error)
- func (p *Provider) Observe(ctx context.Context, target runtimeobs.Target) (runtimeobs.Sample, error)
- func (*Provider) ProviderOperations() providercontract.Operations
- func (p *Provider) Renew(ctx context.Context, r sandbox.Reference) (sandbox.Info, error)
- func (*Provider) RenewCompute(context.Context, sandbox.Reference, sandbox.Compute) (sandbox.ComputeState, error)
- func (*Provider) RestorePreparation(context.Context, sandbox.Reference, string) (bool, error)
- func (*Provider) Resume(context.Context, sandbox.ResumeRequest) (sandbox.ComputeState, error)
- func (*Provider) ResumeCompute(context.Context, sandbox.Reference, sandbox.Compute) (sandbox.ComputeState, error)
- func (p *Provider) RunCommand(ctx context.Context, r sandbox.Reference, c sandbox.Command) (sandbox.CommandResult, error)
- func (*Provider) RunCommandCompute(context.Context, sandbox.Reference, sandbox.Compute, sandbox.Command) (sandbox.CommandResult, error)
- func (*Provider) SavePreparation(context.Context, sandbox.Reference, string) error
- func (*Provider) Suspend(context.Context, sandbox.SuspendRequest) (sandbox.ComputeState, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDirect ¶
func BuildDirect(c sandbox.DirectConfig) (sandbox.SandboxProvider, error)
BuildDirect builds the Provider for one direct-mode selection.
func Operations ¶
func Operations() providercontract.Operations
Operations is this adapter's complete authored resource contract. OpenSandbox pause is specific to its runtime, so the checkpoint lifecycle stays unsupported.
func Policy ¶
func Policy() sandbox.DeploymentPolicy
func Setup ¶
func Setup() sandbox.SetupDeclaration
Setup declares how the console connects an OpenSandbox server. The adapter reads its configuration and credential field names from here.
Types ¶
type ConfigurationAdapter ¶
type ConfigurationAdapter struct{}
func (ConfigurationAdapter) Decode ¶
func (ConfigurationAdapter) Decode(record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
func (ConfigurationAdapter) DecodeInput ¶
func (ConfigurationAdapter) DecodeInput(public, secret json.RawMessage) (sandbox.Configuration, error)
func (ConfigurationAdapter) DiscoverConfiguration ¶
func (ConfigurationAdapter) DiscoverConfiguration(context.Context, sandbox.ConfigurationDiscoveryInput, sandbox.ProcessPaths) (sandbox.ConfigurationOptions, error)
func (ConfigurationAdapter) DiscoverSelection ¶
func (ConfigurationAdapter) DiscoverSelection(context.Context, sandbox.DirectConfig) (sandbox.Selection, error)
func (ConfigurationAdapter) Encode ¶
func (ConfigurationAdapter) Encode(value sandbox.Configuration) (sandbox.ConfigurationRecord, error)
func (ConfigurationAdapter) Equal ¶
func (ConfigurationAdapter) Equal(a, b sandbox.Configuration) (bool, error)
func (ConfigurationAdapter) Requirements ¶
func (ConfigurationAdapter) Requirements() sandbox.ConfigurationRequirements
func (ConfigurationAdapter) ResolveChange ¶
func (a ConfigurationAdapter) ResolveChange(next, previous sandbox.Selection) (sandbox.Selection, error)
ResolveChange inherits the previous key when the change supplies none.
func (ConfigurationAdapter) VerifyCredential ¶
func (ConfigurationAdapter) VerifyCredential(ctx context.Context, c sandbox.DirectConfig, refs []sandbox.Reference) error
VerifyCredential is read-only and bounded: the key must list sandboxes, and every Core-owned reference must list sandboxes of this installation.
func (ConfigurationAdapter) WithCredential ¶
func (ConfigurationAdapter) WithCredential(owner, candidate sandbox.Configuration) (sandbox.Configuration, error)
type DeploymentConfiguration ¶
type DeploymentConfiguration struct {
CredentialSupplied bool `json:"-"`
APIKey string `json:"-"`
APIURL string `json:"api_url"`
Image string `json:"image"`
}
DeploymentConfiguration keeps the API key out of JSON and diagnostics; ConfigurationAdapter.Encode owns the public projection. APIURL is the server origin: the adapter appends /v1.
func (*DeploymentConfiguration) HasCredential ¶
func (c *DeploymentConfiguration) HasCredential() bool
func (*DeploymentConfiguration) MarshalJSON ¶
func (*DeploymentConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON blocks accidental serialization.
func (*DeploymentConfiguration) ReplacesCredential ¶
func (c *DeploymentConfiguration) ReplacesCredential() bool
func (*DeploymentConfiguration) String ¶
func (c *DeploymentConfiguration) String() string
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider runs sandboxes on one OpenSandbox server. A sandbox is identified by its ownership metadata alone.
func (*Provider) DeleteSnapshot ¶
func (*Provider) GetCompute ¶
func (*Provider) Kill ¶
Kill deletes every sandbox of the allocation after verifying that all of them are owned, then confirms none is left.
func (*Provider) KillCompute ¶
func (*Provider) NewCompute ¶
func (*Provider) Observe ¶
func (p *Provider) Observe(ctx context.Context, target runtimeobs.Target) (runtimeobs.Sample, error)
Observe reads execd's metrics for one running, owned sandbox. It never writes, renews or restarts anything.
func (*Provider) ProviderOperations ¶
func (*Provider) ProviderOperations() providercontract.Operations
func (*Provider) Renew ¶
Renew extends the native lease of a running sandbox. Any other state is reported, never renewed.
func (*Provider) RenewCompute ¶
func (*Provider) RestorePreparation ¶
func (*Provider) Resume ¶
func (*Provider) Resume(context.Context, sandbox.ResumeRequest) (sandbox.ComputeState, error)
func (*Provider) ResumeCompute ¶
func (*Provider) RunCommand ¶
func (p *Provider) RunCommand(ctx context.Context, r sandbox.Reference, c sandbox.Command) (sandbox.CommandResult, error)
RunCommand runs once and never replays. Stdin is staged in a private file so that confidential bytes never enter argv.
func (*Provider) RunCommandCompute ¶
func (*Provider) SavePreparation ¶
func (*Provider) Suspend ¶
func (*Provider) Suspend(context.Context, sandbox.SuspendRequest) (sandbox.ComputeState, error)