sandbox

package
v0.0.0-...-61148be Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package sandbox defines the public durable sandbox control contract.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeControlOperationRequest

func EncodeControlOperationRequest(request OperationRequest) ([]byte, error)

EncodeControlOperationRequest returns the canonical sandbox.control/v1 representation used for an immutable runtime tool-action descriptor.

Types

type ApprovalDecision

type ApprovalDecision string
const (
	ApprovalApproved ApprovalDecision = "approved"
	ApprovalDenied   ApprovalDecision = "denied"
)

type ApproveSensitiveOperationRequest

type ApproveSensitiveOperationRequest struct {
	SensitiveOperationID OperationID
	Decision             ApprovalDecision
	ExpiresAt            time.Time
}

type ArtifactID

type ArtifactID string

type ArtifactRef

type ArtifactRef struct {
	ID        ArtifactID
	MediaType string
	SizeBytes uint64
	Digest    Digest
}

type ArtifactResult

type ArtifactResult struct{ Artifact ArtifactRef }

type AttachVolumeRequest

type AttachVolumeRequest struct {
	SandboxID SandboxID
	VolumeID  VolumeID
	Target    GuestPath
	Mode      AttachmentMode
}

type AttachmentMode

type AttachmentMode string
const (
	AttachmentReadOnly  AttachmentMode = "read-only"
	AttachmentReadWrite AttachmentMode = "read-write"
)

type CapabilityDescriptor

type CapabilityDescriptor struct {
	State              CapabilityState
	ContractVersion    string
	ConformanceVersion string
	DataPlane          string
	LimitPrecision     []string
}

type CapabilityFeature

type CapabilityFeature string
const (
	CapabilityIsolation CapabilityFeature = "isolation"
	CapabilityEgress    CapabilityFeature = "egress"
	CapabilityMounts    CapabilityFeature = "mounts"
	CapabilityVolumes   CapabilityFeature = "volumes"
	CapabilitySnapshots CapabilityFeature = "snapshots"
	CapabilitySecrets   CapabilityFeature = "command-secrets"
	CapabilityTransfer  CapabilityFeature = "transfer"
	CapabilityReconnect CapabilityFeature = "reconnect"
)

type CapabilityRequirement

type CapabilityRequirement struct {
	Feature CapabilityFeature
	Minimum CapabilityState
}

type CapabilityRequirements

type CapabilityRequirements struct{ Required []CapabilityRequirement }

type CapabilitySnapshot

type CapabilitySnapshot struct {
	Digest          Digest
	SchemaVersion   string
	ControlProtocol CapabilityDescriptor
	Isolation       CapabilityDescriptor
	Guest           CapabilityDescriptor
	Resources       CapabilityDescriptor
	Reconnect       CapabilityDescriptor
	ImageAdmission  CapabilityDescriptor
	Output          CapabilityDescriptor
	Transfer        CapabilityDescriptor
	Mounts          CapabilityDescriptor
	Volumes         CapabilityDescriptor
	Snapshots       CapabilityDescriptor
	Egress          CapabilityDescriptor
	Secrets         CapabilityDescriptor
	Signals         []Signal
	Trust           KeyLifecycle
}

type CapabilityState

type CapabilityState string
const (
	CapabilityUnavailable CapabilityState = "unavailable"
	CapabilityDeclared    CapabilityState = "declared"
	CapabilityEnforced    CapabilityState = "enforced"
)

type Client

func NewClient

func NewClient(ctx context.Context, config ClientConfig) (Client, error)

NewClient constructs and binds a Principal-scoped HTTPS control client.

type ClientConfig

type ClientConfig struct {
	Endpoint       Endpoint
	TLS            TLSConfig
	Credentials    CredentialSource
	TrustBundles   TrustBundleSource
	RequestTimeout time.Duration
}

type CloseSandboxRequest

type CloseSandboxRequest struct{ SandboxID SandboxID }

type Command

type Command struct {
	Executable              GuestPath
	Argv                    []string
	WorkDir                 GuestPath
	User                    NumericIdentity
	Umask                   FileMode
	Environment             map[string]string
	Grant                   Grant
	StartDeadline           time.Duration
	RuntimeLimit            time.Duration
	BindLifetimeToOperation bool
}

type ControlAction

type ControlAction string
const (
	ControlSignaled   ControlAction = "signaled"
	ControlKilled     ControlAction = "killed"
	ControlCopiedIn   ControlAction = "copied-in"
	ControlClosed     ControlAction = "closed"
	ControlReconciled ControlAction = "reconciled"
	ControlAttached   ControlAction = "attached"
	ControlDetached   ControlAction = "detached"
	ControlDeleted    ControlAction = "deleted"
	ControlApproved   ControlAction = "approved"
)

type ControlResult

type ControlResult struct {
	Action  ControlAction
	Cleanup TreeCleanupState
}

type CopyInRequest

type CopyInRequest struct {
	SandboxID   SandboxID
	Source      ArtifactRef
	Destination GuestPath
	Options     TransferOptions
}

type CopyOutRequest

type CopyOutRequest struct {
	SandboxID SandboxID
	Source    GuestPath
	Options   TransferOptions
}

type CreateSandboxRequest

type CreateSandboxRequest struct{ Spec SandboxSpec }

type CreateVolumeRequest

type CreateVolumeRequest struct{ Spec VolumeSpec }

type CredentialSink

type CredentialSink interface {
	SetAuthorization(string, string) error
	ClearAuthorization()
}

type CredentialSource

type CredentialSource interface {
	Apply(context.Context, CredentialSink) error
}

type DeleteSnapshotRequest

type DeleteSnapshotRequest struct{ SnapshotID SnapshotID }

type DeleteVolumeRequest

type DeleteVolumeRequest struct{ VolumeID VolumeID }

type DetachVolumeRequest

type DetachVolumeRequest struct {
	SandboxID SandboxID
	VolumeID  VolumeID
}

type Digest

type Digest string

type DomainPattern

type DomainPattern string

type Endpoint

type Endpoint struct{ URL string }

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Failure

func (e *Error) Failure() Failure

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ExecProcessRequest

type ExecProcessRequest struct {
	SandboxID SandboxID
	Command   Command
}

type Failure

type Failure struct {
	Code    FailureCode
	Message string
	Retry   RetryClass
	Details []FailureDetail
}

func AsFailure

func AsFailure(err error) (Failure, bool)

type FailureCode

type FailureCode string
const (
	FailureInvalidArgument             FailureCode = "invalid-argument"
	FailureNotFoundOrDenied            FailureCode = "not-found-or-denied"
	FailureOperationConflict           FailureCode = "operation-conflict"
	FailureAlreadyTerminal             FailureCode = "already-terminal"
	FailureCursorExpired               FailureCode = "cursor-expired"
	FailureOutputGap                   FailureCode = "output-gap"
	FailureGrantWideningDenied         FailureCode = "grant-widening-denied"
	FailureNetworkGrantInvalid         FailureCode = "network-grant-invalid"
	FailureCapabilityUnavailable       FailureCode = "capability-unavailable"
	FailureCapabilityRegressed         FailureCode = "capability-regressed"
	FailureResourceLimitExceeded       FailureCode = "resource-limit-exceeded"
	FailureControlQuotaExceeded        FailureCode = "control-quota-exceeded"
	FailureIncompatiblePersistedPolicy FailureCode = "incompatible-persisted-policy"
	FailureOutcomeUncertain            FailureCode = "outcome-uncertain"
	FailureCancelled                   FailureCode = "cancelled"
	FailureDeadlineExceeded            FailureCode = "deadline-exceeded"
	FailureUnavailable                 FailureCode = "unavailable"
)

type FailureDetail

type FailureDetail struct {
	Key   FailureDetailKey
	Value string
}

type FailureDetailKey

type FailureDetailKey string
const (
	DetailField            FailureDetailKey = "field"
	DetailLimit            FailureDetailKey = "limit"
	DetailResource         FailureDetailKey = "resource"
	DetailCapability       FailureDetailKey = "capability"
	DetailPolicyVersion    FailureDetailKey = "policy-version"
	DetailEarliestCursor   FailureDetailKey = "earliest-cursor"
	DetailOperationState   FailureDetailKey = "operation-state"
	DetailRetryAfterMillis FailureDetailKey = "retry-after-millis"
)

type FileMode

type FileMode uint32

type Grant

type Grant struct {
	Secrets GrantSelection
	Mounts  GrantSelection
	Network NetworkGrantSelection
}

type GrantMode

type GrantMode string
const (
	GrantNone    GrantMode = "none"
	GrantSelect  GrantMode = "select"
	GrantInherit GrantMode = "inherit"
)

type GrantSelection

type GrantSelection struct {
	Mode  GrantMode
	Names []string
}

type GuestPath

type GuestPath string

type HostID

type HostID string

type HostRoute

type HostRoute struct {
	HostID         HostID
	Generation     uint64
	LeaseExpiresAt time.Time
}

type ImageInfo

type ImageInfo struct {
	Digest                 Digest
	Architecture           string
	Identity               NumericIdentity
	GuestProtocol          string
	AdmissionPolicyVersion string
}

type ImageRef

type ImageRef struct{ Digest Digest }

type KeyLifecycle

type KeyLifecycle struct {
	TrustBundleVersion      string
	ControlSigningKeyID     string
	ControlSigningAlgorithm string
	RevocationEpoch         uint64
	NotBefore               time.Time
	NotAfter                time.Time
	RotationGrace           time.Duration
}

type KillProcessRequest

type KillProcessRequest struct{ ProcessID ProcessID }

type MountMode

type MountMode string
const (
	MountReadOnly  MountMode = "read-only"
	MountReadWrite MountMode = "read-write"
)

type MountRequest

type MountRequest struct {
	Name   string
	Target GuestPath
	Mode   MountMode
	View   MountView
}

type MountView

type MountView string
const (
	MountLive   MountView = "live"
	MountFrozen MountView = "frozen"
)

type NetworkGrantSelection

type NetworkGrantSelection struct {
	Mode  GrantMode
	Rules []NetworkRule
}

type NetworkProtocol

type NetworkProtocol string
const (
	NetworkTCP NetworkProtocol = "tcp"
	NetworkUDP NetworkProtocol = "udp"
)

type NetworkRule

type NetworkRule struct {
	Protocol NetworkProtocol
	Domain   DomainPattern
	Ports    []PortRange
}

type NumericIdentity

type NumericIdentity struct {
	UID    uint32
	GID    uint32
	Groups []uint32
}

type Operation

type Operation struct {
	Ref                 OperationRef
	Kind                OperationKind
	State               OperationState
	Target              OperationTarget
	CanonicalDigest     Digest
	EffectiveSpecDigest Digest
	CapabilityDigest    Digest
	Result              *OperationResult
	Failure             *Failure
	RetentionExpiresAt  time.Time
	LatestCursor        OperationCursor
}

type OperationAdmissionPolicy

type OperationAdmissionPolicy struct {
	Version               string
	CanonicalizerVersion  string
	CapabilityVersion     string
	ImageAdmissionVersion string
	Defaults              ResourceLimits
	Maximum               ResourceLimits
	Capabilities          CapabilitySnapshot
	AdmittedImages        map[Digest]ImageInfo
}

OperationAdmissionPolicy is the explicit, versioned authority used by a control service to freeze and resolve an Operation request before durable acceptance. Maps and slices are defensively copied during resolution.

type OperationCursor

type OperationCursor string

type OperationEvent

type OperationEvent struct {
	Kind   OperationEventKind
	Cursor OperationCursor
	Update *Operation
	Gap    *OperationGap
}

type OperationEventKind

type OperationEventKind string
const (
	OperationEventUpdate OperationEventKind = "update"
	OperationEventGap    OperationEventKind = "gap"
)

type OperationGap

type OperationGap struct {
	EarliestRetained OperationCursor
	Reason           string
}

type OperationID

type OperationID string

type OperationKind

type OperationKind string
const (
	OperationCreateSandbox    OperationKind = "create-sandbox"
	OperationRestoreSandbox   OperationKind = "restore-sandbox"
	OperationExecProcess      OperationKind = "exec-process"
	OperationSignalProcess    OperationKind = "signal-process"
	OperationKillProcess      OperationKind = "kill-process"
	OperationCopyIn           OperationKind = "copy-in"
	OperationCopyOut          OperationKind = "copy-out"
	OperationSnapshotSandbox  OperationKind = "snapshot-sandbox"
	OperationCloseSandbox     OperationKind = "close-sandbox"
	OperationReconcileSandbox OperationKind = "reconcile-sandbox"
	OperationCreateVolume     OperationKind = "create-volume"
	OperationAttachVolume     OperationKind = "attach-volume"
	OperationDetachVolume     OperationKind = "detach-volume"
	OperationDeleteVolume     OperationKind = "delete-volume"
	OperationDeleteSnapshot   OperationKind = "delete-snapshot"
	OperationApproveSensitive OperationKind = "approve-sensitive-operation"
)

type OperationRef

type OperationRef struct {
	ID         OperationID
	AcceptedAt time.Time
}

type OperationRequest

type OperationRequest struct {
	ID               OperationID
	Kind             OperationKind
	CreateSandbox    *CreateSandboxRequest
	RestoreSandbox   *RestoreSandboxRequest
	ExecProcess      *ExecProcessRequest
	SignalProcess    *SignalProcessRequest
	KillProcess      *KillProcessRequest
	CopyIn           *CopyInRequest
	CopyOut          *CopyOutRequest
	SnapshotSandbox  *SnapshotSandboxRequest
	CloseSandbox     *CloseSandboxRequest
	ReconcileSandbox *ReconcileSandboxRequest
	CreateVolume     *CreateVolumeRequest
	AttachVolume     *AttachVolumeRequest
	DetachVolume     *DetachVolumeRequest
	DeleteVolume     *DeleteVolumeRequest
	DeleteSnapshot   *DeleteSnapshotRequest
	ApproveSensitive *ApproveSensitiveOperationRequest
}
Example
package main

import (
	"time"

	"github.com/0x63616c/agent-runtime/sandbox"
)

func main() {
	request := sandbox.OperationRequest{
		ID:   "op_create_example",
		Kind: sandbox.OperationCreateSandbox,
		CreateSandbox: &sandbox.CreateSandboxRequest{Spec: sandbox.SandboxSpec{
			Image: sandbox.ImageRef{Digest: "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"},
			Resources: sandbox.ResourceLimits{
				MilliCPU:            100,
				MemoryBytes:         128 << 20,
				RootDiskBytes:       1 << 30,
				TmpfsBytes:          64 << 20,
				PIDs:                64,
				ProcessCount:        16,
				OpenFiles:           128,
				Inodes:              1024,
				Files:               1024,
				Lifetime:            time.Minute,
				ProducedOutputBytes: 1 << 20,
				RetainedOutputBytes: 64 << 10,
				TransferBytes:       1 << 20,
				NetworkConnections:  16,
				VolumeBytes:         1 << 30,
				SnapshotBytes:       1 << 30,
			},
		}},
	}
	_ = request
}

func DecodeControlOperationRequest

func DecodeControlOperationRequest(input []byte) (OperationRequest, error)

DecodeControlOperationRequest accepts only canonical sandbox.control/v1 request bytes. Runtime workers use it after state authorizes the immutable descriptor and before they submit any external effect.

type OperationResult

type OperationResult struct {
	Kind     OperationResultKind
	Sandbox  *SandboxResult
	Process  *ProcessResult
	Artifact *ArtifactResult
	Volume   *VolumeResult
	Snapshot *SnapshotResult
	Control  *ControlResult
}

type OperationResultKind

type OperationResultKind string
const (
	ResultSandbox  OperationResultKind = "sandbox"
	ResultProcess  OperationResultKind = "process"
	ResultArtifact OperationResultKind = "artifact"
	ResultVolume   OperationResultKind = "volume"
	ResultSnapshot OperationResultKind = "snapshot"
	ResultControl  OperationResultKind = "control"
)

type OperationState

type OperationState string
const (
	OperationAccepted         OperationState = "accepted"
	OperationQueued           OperationState = "queued"
	OperationDispatched       OperationState = "dispatched"
	OperationStarted          OperationState = "started"
	OperationSucceeded        OperationState = "succeeded"
	OperationFailed           OperationState = "failed"
	OperationCancelled        OperationState = "cancelled"
	OperationUncertain        OperationState = "uncertain"
	OperationCleanupPending   OperationState = "cleanup-pending"
	OperationCleanupConfirmed OperationState = "cleanup-confirmed"
	OperationExpired          OperationState = "expired"
	OperationTombstoned       OperationState = "tombstoned"
)

type OperationStream

type OperationStream interface {
	Next(context.Context) (OperationEvent, error)
	Close() error
}

type OperationTarget

type OperationTarget struct {
	Kind        OperationTargetKind
	SandboxID   SandboxID
	ProcessID   ProcessID
	VolumeID    VolumeID
	SnapshotID  SnapshotID
	OperationID OperationID
}

type OperationTargetKind

type OperationTargetKind string
const (
	TargetSandbox   OperationTargetKind = "sandbox"
	TargetProcess   OperationTargetKind = "process"
	TargetVolume    OperationTargetKind = "volume"
	TargetSnapshot  OperationTargetKind = "snapshot"
	TargetOperation OperationTargetKind = "operation"
	TargetNone      OperationTargetKind = "none"
)

type OutputChunk

type OutputChunk struct {
	Bytes    []byte
	Redacted bool
}

type OutputCursor

type OutputCursor string

type OutputEvent

type OutputEvent struct {
	Kind   OutputEventKind
	Cursor OutputCursor
	Stream OutputKind
	Chunk  *OutputChunk
	Gap    *OutputGap
	Final  *OutputFinal
}

type OutputEventKind

type OutputEventKind string
const (
	OutputEventChunk OutputEventKind = "chunk"
	OutputEventGap   OutputEventKind = "gap"
	OutputEventFinal OutputEventKind = "final"
)

type OutputFinal

type OutputFinal struct{ Result ProcessResult }

type OutputGap

type OutputGap struct {
	EarliestRetained OutputCursor
	Reason           string
}

type OutputKind

type OutputKind string
const (
	OutputStdout OutputKind = "stdout"
	OutputStderr OutputKind = "stderr"
)

type OutputRetention

type OutputRetention struct {
	EarliestCursor OutputCursor
	RetainedBytes  uint64
	Truncated      bool
}

type OutputStream

type OutputStream interface {
	Next(context.Context) (OutputEvent, error)
	Close() error
}

type OverwriteMode

type OverwriteMode string
const (
	OverwriteFailIfExists  OverwriteMode = "fail-if-exists"
	OverwriteAtomicReplace OverwriteMode = "atomic-replace"
)

type Page

type Page struct {
	Cursor PageCursor
	Limit  uint32
}

type PageCursor

type PageCursor string

type PortRange

type PortRange struct {
	First uint16
	Last  uint16
}

type ProcessID

type ProcessID string

type ProcessInfo

type ProcessInfo struct {
	ID        ProcessID
	SandboxID SandboxID
	State     ProcessState
	Result    *ProcessResult
	Stdout    OutputRetention
	Stderr    OutputRetention
}

type ProcessResult

type ProcessResult struct {
	StartedAt  time.Time
	FinishedAt time.Time
	ExitCode   *int
	Signal     *Signal
	Reason     TerminationReason
	Usage      ResourceUsage
	Cleanup    TreeCleanupState
}

type ProcessState

type ProcessState string
const (
	ProcessAccepted    ProcessState = "accepted"
	ProcessStarting    ProcessState = "starting"
	ProcessRunning     ProcessState = "running"
	ProcessTerminating ProcessState = "terminating"
	ProcessTerminal    ProcessState = "terminal"
)

type ReconcileSandboxRequest

type ReconcileSandboxRequest struct{ SandboxID SandboxID }

type ResolvedOperation

type ResolvedOperation struct {
	Operation Operation
	// InputDigest identifies the exact canonical wire request before operator
	// defaults are resolved. Control stores use it to reconnect retries to the
	// already accepted effective policy instead of silently adopting new defaults.
	InputDigest     Digest
	CleanupRequired bool
}

ResolvedOperation is the bounded output of strict control-wire decoding and admission. It contains safe metadata only; secret values and backend handles are never part of this value.

func ResolveControlOperationRequest

func ResolveControlOperationRequest(input []byte, acceptedAt, retentionExpiresAt time.Time, policy OperationAdmissionPolicy) (ResolvedOperation, error)

ResolveControlOperationRequest strictly decodes sandbox.control/v1 bytes, freezes caller-owned input, resolves finite defaults and admission policy, and returns the durable public Operation metadata.

type ResourceLimits

type ResourceLimits struct {
	MilliCPU            uint32
	MemoryBytes         uint64
	RootDiskBytes       uint64
	TmpfsBytes          uint64
	PIDs                uint32
	ProcessCount        uint32
	OpenFiles           uint32
	Inodes              uint64
	Files               uint64
	Lifetime            time.Duration
	ProducedOutputBytes uint64
	RetainedOutputBytes uint64
	TransferBytes       uint64
	NetworkConnections  uint32
	VolumeBytes         uint64
	SnapshotBytes       uint64
}

type ResourceUsage

type ResourceUsage struct {
	CPUTime         time.Duration
	PeakMemoryBytes uint64
	ReadBytes       uint64
	WrittenBytes    uint64
}

type RestoreSandboxRequest

type RestoreSandboxRequest struct {
	SnapshotID SnapshotID
	Overrides  SandboxOverrides
}

type RetryClass

type RetryClass string
const (
	RetryNever            RetryClass = "never"
	RetryAfterReconcile   RetryClass = "after-reconcile"
	RetryCallerControlled RetryClass = "caller-controlled"
)

type SandboxActualState

type SandboxActualState string
const (
	SandboxPending      SandboxActualState = "pending"
	SandboxProvisioning SandboxActualState = "provisioning"
	SandboxReady        SandboxActualState = "ready"
	SandboxQuiescing    SandboxActualState = "quiescing"
	SandboxCleaning     SandboxActualState = "cleaning"
	SandboxFailed       SandboxActualState = "failed"
	SandboxUnreachable  SandboxActualState = "unreachable"
	SandboxLost         SandboxActualState = "lost"
	SandboxDeleted      SandboxActualState = "deleted"
)

type SandboxDesiredState

type SandboxDesiredState string
const (
	SandboxActive SandboxDesiredState = "active"
	SandboxClosed SandboxDesiredState = "closed"
)

type SandboxID

type SandboxID string

type SandboxInfo

type SandboxInfo struct {
	ID           SandboxID
	Desired      SandboxDesiredState
	Actual       SandboxActualState
	Image        ImageInfo
	Resources    ResourceLimits
	Capabilities CapabilitySnapshot
	Host         HostRoute
	Failure      *Failure
}

type SandboxOverrides

type SandboxOverrides struct {
	Resources    *ResourceLimits
	Capabilities *CapabilityRequirements
}

type SandboxResult

type SandboxResult struct{ ID SandboxID }

type SandboxSpec

type SandboxSpec struct {
	Image             ImageRef
	Resources         ResourceLimits
	Environment       map[string]string
	SecretBindings    []SecretBinding
	VolumeAttachments []VolumeAttachment
	Mounts            []MountRequest
	Tmpfs             []TmpfsMount
	Capabilities      CapabilityRequirements
	Labels            map[string]string
}

type SecretBinding

type SecretBinding struct {
	Name    string
	Purpose string
}

type Signal

type Signal string
const (
	SignalInterrupt Signal = "interrupt"
	SignalTerminate Signal = "terminate"
	SignalKill      Signal = "kill"
	SignalHangup    Signal = "hangup"
)

type SignalProcessRequest

type SignalProcessRequest struct {
	ProcessID ProcessID
	Signal    Signal
}

type SnapshotID

type SnapshotID string

type SnapshotInfo

type SnapshotInfo struct {
	ID                 SnapshotID
	SourceSandboxID    SandboxID
	Digest             Digest
	SizeBytes          uint64
	Tainted            bool
	RetentionExpiresAt time.Time
}

type SnapshotPage

type SnapshotPage struct {
	Items []SnapshotInfo
	Next  PageCursor
}

type SnapshotResult

type SnapshotResult struct{ ID SnapshotID }

type SnapshotRiskAttestation

type SnapshotRiskAttestation struct {
	Risk  string
	Owner string
}

type SnapshotSandboxRequest

type SnapshotSandboxRequest struct {
	SandboxID       SandboxID
	RiskAttestation *SnapshotRiskAttestation
}

type StaticTrustBundleSource

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

StaticTrustBundleSource is a finite immutable trust adapter for callers that already own PEM roots.

func NewStaticTrustBundleSource

func NewStaticTrustBundleSource(bundles map[TrustBundleRef]TrustBundle) (*StaticTrustBundleSource, error)

NewStaticTrustBundleSource freezes a bounded set of named public trust roots.

func (*StaticTrustBundleSource) ResolveTrustBundle

func (source *StaticTrustBundleSource) ResolveTrustBundle(ctx context.Context, reference TrustBundleRef) (TrustBundle, error)

ResolveTrustBundle returns a defensive trust snapshot selected by its opaque declared reference.

type TLSConfig

type TLSConfig struct {
	ServerName     string
	TrustBundleRef TrustBundleRef
}

type TerminationReason

type TerminationReason string
const (
	TerminationExited               TerminationReason = "exited"
	TerminationSignaled             TerminationReason = "signaled"
	TerminationTimedOut             TerminationReason = "timed-out"
	TerminationOOMKilled            TerminationReason = "oom-killed"
	TerminationOutputLimit          TerminationReason = "output-limit"
	TerminationCancelled            TerminationReason = "cancelled"
	TerminationKilledByCaller       TerminationReason = "killed-by-caller"
	TerminationSandboxClosed        TerminationReason = "sandbox-closed"
	TerminationSandboxLost          TerminationReason = "sandbox-lost"
	TerminationStartupFailed        TerminationReason = "startup-failed"
	TerminationInfrastructureFailed TerminationReason = "infrastructure-failed"
	TerminationOutcomeUncertain     TerminationReason = "outcome-uncertain"
)

type TmpfsMount

type TmpfsMount struct {
	Target    GuestPath
	SizeBytes uint64
	Mode      FileMode
}

type TransferOptions

type TransferOptions struct {
	Overwrite OverwriteMode
	Mode      FileMode
	Owner     *NumericIdentity
	Durable   bool
}

type TreeCleanupState

type TreeCleanupState string
const (
	TreeCleanupConfirmed   TreeCleanupState = "confirmed"
	TreeCleanupPending     TreeCleanupState = "pending"
	TreeCleanupNotRequired TreeCleanupState = "not-required"
	TreeCleanupUnknown     TreeCleanupState = "unknown"
)

type TrustBundle

type TrustBundle struct {
	Version  string
	PEMRoots []byte
}

TrustBundle is a resolved, versioned PEM root bundle.

type TrustBundleRef

type TrustBundleRef string

TrustBundleRef is an opaque reference to a versioned set of trusted roots.

type TrustBundleSource

type TrustBundleSource interface {
	ResolveTrustBundle(context.Context, TrustBundleRef) (TrustBundle, error)
}

TrustBundleSource resolves trust bundle references without ambient system roots.

type VolumeAttachment

type VolumeAttachment struct {
	VolumeID VolumeID
	Target   GuestPath
	Mode     AttachmentMode
}

type VolumeAttachmentInfo

type VolumeAttachmentInfo struct {
	SandboxID      SandboxID
	Generation     uint64
	LeaseExpiresAt time.Time
	Mode           AttachmentMode
}

type VolumeID

type VolumeID string

type VolumeInfo

type VolumeInfo struct {
	ID                 VolumeID
	SizeBytes          uint64
	Inodes             uint64
	Attachment         *VolumeAttachmentInfo
	Tainted            bool
	RetentionExpiresAt time.Time
}

type VolumePage

type VolumePage struct {
	Items []VolumeInfo
	Next  PageCursor
}

type VolumeResult

type VolumeResult struct {
	ID         VolumeID
	Attachment *VolumeAttachmentInfo
}

type VolumeSpec

type VolumeSpec struct {
	SizeBytes uint64
	Inodes    uint64
	Labels    map[string]string
}

Jump to

Keyboard shortcuts

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