Stow
API referenceView source

Go API

Import github.com/chester-hill-solutions/stow-s3/pkg/stow. Use Runtime for objects and Workspace for editable directories and checkpoints.

Defaults and limits

Setting Value
Open Memory when no Store is supplied
MaxBytes / MaxObjects Zero means unlimited
MaxMultipartUploads Zero selects 1,024; negative values are invalid
Authority nil permits all operations; ReadWrite excludes upstream and destruction
ListOptions.Limit Zero selects 1,000 objects per page; negative values are invalid
CheckpointArchiveOptions Defaults to 1 GiB / 100,000 files

Behavior

  • Pass a context to operations for cancellation.
  • Check Capabilities before optional operations.
  • ETag conditions compare content; ReadForSave/SaveObject also detect managed metadata and generation changes.
  • Save results distinguish SaveCommitted, SaveNotCommitted and SaveUnknown.
  • Persist request keys before durable saves or captures.
  • Resolve uncertain results before retrying.
  • Close preserves durable data; Destroy is a separate authorized operation.
  • Workspace embeds Runtime and inherits its object methods.
  • Store extensions advertise conditional, staged, streaming, range and multipart support independently.

Errors

  • Use errors.Is for sentinel errors and errors.As for structured errors.
  • ErrPreconditionFailed and ErrSaveConflict preserve current data.
  • ErrMutationCommitted means content was published despite a later index error; inspect the returned object before retrying.
  • ErrSaveRequestUnknown and SaveUnknown require resolution.
  • ErrQuotaExceeded bounds managed storage, not process memory or direct host writes.

Example

Go8 lines
runtime, err := stow.Open(stow.Options{MaxBytes: 16 << 20, MaxObjects: 1000})
if err != nil { return err }
defer runtime.Close()
ctx := context.Background()
if err := runtime.CreateBucket(ctx, "files"); err != nil { return err }
object, err := runtime.PutObject(ctx, "files", "note.txt", []byte("hello"), stow.PutOptions{ContentType: "text/plain"})
if err != nil { return err }
_ = object

Symbols

AddRecoveryHold · AdoptHandoff · AdoptHandoffArchive · AllowAll · AllowNone · ApplyDelta · ApplyDeltaWithOptions · Authority · Backend · BackendFilesystem · BackendHost · BackendMemory · BackendWorkspace · Bucket · BucketCreate · BucketDelete · BucketList · Capabilities · CapacityHost · CapacityHostOptions · CapacityNamespace · CapacityNamespaceOptions · CapacitySnapshot · CaptureCheckpoint · CapturePrincipal · CheckpointArchiveOptions · CheckpointArchivePreview · CheckpointBucketChange · CheckpointChange · CheckpointError · CheckpointFile · CheckpointHold · CheckpointInfo · CheckpointManifest · CheckpointObject · CheckpointObjectChange · CheckpointOf · CheckpointOfAuthorized · CheckpointOptions · CheckpointProvenance · CheckpointReadDirectory · CheckpointReader · CheckpointReaderOptions · CheckpointReadReference · CheckpointReadResult · CheckpointRepository · CheckpointRequest · CheckpointResult · Collect · CollectOptions · CollectResult · CompareCheckpoints · ComparePortableCheckpoints · ConditionalWriteStore · CopyStore · CreateDelta · DecodeDelta · DefaultWorkspaceRegistryDir · DefaultWorkspaceRegistryDirForTeam · DeleteCheckpoint · DeltaChange · DeltaChangeAdded · DeltaChangeChanged · DeltaChangeDeleted · DeltaDocument · DeltaDocumentDigest · DeltaOptions · DeltaVersion · DestroyRegisteredWorkspace · DiscardRecoveryHold · EncodeDelta · EnvironmentDestroy · EnvironmentPromote · EnvironmentReset · ErrBucketExists · ErrBucketNotEmpty · ErrBucketNotFound · ErrCapacityConflict · ErrCapacityFull · ErrCapacityInvalid · ErrCapacityUnknown · ErrCheckpointInUse · ErrCheckpointReadClosed · ErrCheckpointReadExpired · ErrCheckpointReadTooLarge · ErrCheckpointReadUnavailable · ErrClosed · ErrConditionalWritesUnsupported · ErrDeltaConflict · ErrDeltaDigestMismatch · ErrDeltaTooLarge · ErrDeltaVersionUnsupported · ErrGuardedSavesUnsupported · ErrHandoffDigestMismatch · ErrInvalidBucket · ErrInvalidKey · ErrInvalidListLimit · ErrInvalidRecoveryHold · ErrInvalidSaveCondition · ErrInvalidSaveRequest · ErrMutationCommitted · ErrNotAuthorized · ErrObjectNotFound · ErrPreconditionFailed · ErrQuotaExceeded · ErrRecoveryHeld · ErrRecoveryHoldConflict · ErrRecoveryHoldCorrupt · ErrRecoveryHoldFull · ErrRecoveryHoldNotFound · ErrRecoveryHoldsUnsupported · ErrSaveConflict · ErrSaveRequestConflict · ErrSaveRequestFull · ErrSaveRequestNotCommitted · ErrSaveRequestNotFound · ErrSaveRequestsUnsupported · ErrSaveRequestUnknown · ErrUnsupportedBackend · ErrWorkspaceEditorClosed · ErrWorkspaceEditorUnavailable · ErrWorkspaceObservationFull · ErrWorkspaceObservationInvalid · ErrWorkspaceReadChanged · ErrWorkspaceReaderClosed · ErrWorkspaceReadTooLarge · ErrWorkspaceReadUnavailable · ExportCheckpoint · ExportHandoff · FilesystemOptions · GetRegistryPolicy · GitRepositoryInput · Handoff · HandoffArchive · HandoffError · HandoffExportOptions · ImportCheckpoint · ImportHandoff · List · ListOptions · ListRecoveryHolds · ListWorkspacesOptions · LoadCheckpoint · LookupWorkspace · MaxDeltaBytes · MaxRecoveryHoldBytes · MaxRecoveryHoldPeakBytes · MaxRecoveryHolds · MaxRecoveryReferences · MultipartOptions · MultipartStore · MultipartUpload · Object · ObjectDelete · ObjectList · ObjectPage · ObjectRange · ObjectRead · ObjectRecoveryHoldOptions · ObjectRecoveryReference · ObjectWrite · Open · OpenAdapter · OpenCapacityHost · OpenCheckpointReader · OpenFilesystem · OpenWorkspace · OpenWorkspaceReader · Operation · Options · Part · PortableCheckpointDiff · PreparedRepository · PreparedWorkspace · PrepareOptions · PrepareWorkspace · PreviewCheckpointArchive · Prune · PruneOptions · PruneResult · PutOptions · RangeStore · ReadCheckpointFile · ReadHandoff · ReadHandoffReader · ReadOnly · ReadWrite · RecoveryHold · RecoveryHoldPage · RecoveryHoldQuery · RecoveryHoldRequest · RecoveryReference · RegistryPolicy · ReleaseRecoveryHold · ReplacementCondition · ResolveCheckpoint · ResolveRegistryDir · RestoreCheckpoint · RestoreCheckpointWithGit · Resume · ResumeIn · ResumeWith · ResumeWorkspaceForFileRecovery · Runtime · SaveCommitted · SaveCondition · SaveNotCommitted · SaveOptions · SaveOutcome · SaveResult · SaveUnknown · SetRegistryPolicy · StagedObject · StagedWriteStore · Store · StreamingStore · StreamingWriteStore · StreamPutOptions · UpstreamRead · UpstreamWrite · Usage · ValidateHandoff · VerifyDeltaDigest · Workspace · WorkspaceDirectoryObservation · WorkspaceEditOptions · WorkspaceEditor · WorkspaceFacade · WorkspaceFacadeOptions · WorkspaceFileRead · WorkspaceFileSaveRequest · WorkspaceFileSaveResult · WorkspaceInput · WorkspaceListing · WorkspaceOptions · WorkspaceReadEntry · WorkspaceReader · WorkspaceReaderOptions · WorkspaceReadFile · WorkspaceReference · WorkspaceSummary · WorkspaceTaskManifest

AddRecoveryHold

AddRecoveryHold is host administration over a trusted registry, not a grant from Owner.

Go1 line
func AddRecoveryHold(ctx context.Context, registryDir string, request RecoveryHoldRequest) (RecoveryHold, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
request RecoveryHoldRequest Yes —

Returns: RecoveryHold, error.

AdoptHandoff

AdoptHandoff returns imported checkpoint information even if restoration fails.

Go1 line
func AdoptHandoff(ctx context.Context, path string, options WorkspaceOptions, archiveOptions CheckpointArchiveOptions) (*Workspace, CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
archiveOptions CheckpointArchiveOptions Yes —

Returns: *Workspace, CheckpointInfo, error.

AdoptHandoffArchive

AdoptHandoffArchive consumes the checked document and opened archive without reopening paths.

Go1 line
func AdoptHandoffArchive(ctx context.Context, document Handoff, archive *os.File, options WorkspaceOptions, archiveOptions CheckpointArchiveOptions) (*Workspace, CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
document Handoff Yes — Versioned handoff or delta document.
archive *os.File Yes — Path to a portable checkpoint archive.
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
archiveOptions CheckpointArchiveOptions Yes —

Returns: *Workspace, CheckpointInfo, error.

AllowAll

AllowAll returns an Authority that permits every operation.

Go1 line
func AllowAll() Authority

AllowNone

AllowNone returns an Authority that permits nothing.

Go1 line
func AllowNone() Authority

ApplyDelta

ApplyDelta brings a checkpoint to the state a delta describes, and returns the new checkpoint.

Go1 line
func ApplyDelta(ctx context.Context, registryDir, baseID string, delta *DeltaDocument) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
baseID string Yes — Checkpoint identity that must match the delta's named base.
delta *DeltaDocument Yes — Verified change document to encode or apply.

Returns: CheckpointInfo, error.

ApplyDeltaWithOptions

ApplyDeltaWithOptions applies a transported delta when the receiver explicitly consents to carrying sensitive-looking paths as well as the sender's consent.

Go1 line
func ApplyDeltaWithOptions(ctx context.Context, registryDir, baseID string, delta *DeltaDocument, options DeltaOptions) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
baseID string Yes — Checkpoint identity that must match the delta's named base.
delta *DeltaDocument Yes — Verified change document to encode or apply.
options DeltaOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointInfo, error.

Authority

Authority is a set of permitted operations.

Go1 line
type Authority struct{ Mask uint32 }

Authority.Allows

Allows reports whether op is permitted.

Go1 line
func (a Authority) Allows(op Operation) bool
Parameter Type Required Default Meaning
op Operation Yes — Operation whose permission is being checked.

Returns: bool.

Authority.Check

Check returns *ErrNotAuthorized when op is not permitted.

Go1 line
func (a Authority) Check(op Operation) error
Parameter Type Required Default Meaning
op Operation Yes — Operation whose permission is being checked.

Returns: error.

Authority.Intersect

Intersect returns the operations both a and b permit.

Go1 line
func (a Authority) Intersect(b Authority) Authority
Parameter Type Required Default Meaning
b Authority Yes —

Returns: Authority.

Authority.IsSupersetOf

IsSupersetOf reports whether a permits everything b permits.

Go1 line
func (a Authority) IsSupersetOf(b Authority) bool
Parameter Type Required Default Meaning
b Authority Yes —

Returns: bool.

Authority.Operations

Operations lists what is permitted, sorted, for a descriptor or a diagnostic.

Go1 line
func (a Authority) Operations() []Operation

Returns: []Operation.

Authority.String

String renders the permitted set, for an error message or a log line.

Go1 line
func (a Authority) String() string

Returns: string.

Authority.With

With returns a copy that additionally permits the given operations.

Go1 line
func (a Authority) With(ops ...Operation) Authority
Parameter Type Required Default Meaning
ops ...Operation Yes —

Returns: Authority.

Authority.Without

Without returns a copy that no longer permits the given operations.

Go1 line
func (a Authority) Without(ops ...Operation) Authority
Parameter Type Required Default Meaning
ops ...Operation Yes —

Returns: Authority.

Backend

Go1 line
type Backend string

BackendFilesystem

Go1 line
const BackendFilesystem Backend = "filesystem"

BackendHost

Go1 line
const BackendHost Backend = "host"

BackendMemory

Go1 line
const BackendMemory Backend = "memory"

BackendWorkspace

Go1 line
const BackendWorkspace Backend = "workspace"

Bucket

Go4 lines
type Bucket struct {
	Name		string
	CreationDate	time.Time
}

BucketCreate

Go1 line
const BucketCreate Operation = "bucket.create"

BucketDelete

Go1 line
const BucketDelete Operation = "bucket.delete"

BucketList

Go1 line
const BucketList Operation = "bucket.list"

Capabilities

Return the operations and limits supported by this handle.

Go13 lines
type Capabilities struct {
	Backend			Backend
	MaxBytes		int64
	MaxObjects		int64
	MaxMultipartUploads	int64
	Persistent		bool
	Multipart		bool
	Upstream		bool
	ConditionalWrites	bool
	GuardedSaves		bool
	DurableSaveRequests	bool
	RecoveryHolds		bool
}

CapacityHost

CapacityHost configures trusted namespace budgets; it does not authenticate callers.

Go3 lines
type CapacityHost struct {

}// contains filtered or unexported fields

CapacityHost.BindNamespace

Go1 line
func (h *CapacityHost) BindNamespace(options CapacityNamespaceOptions) (*CapacityNamespace, error)
Parameter Type Required Default Meaning
options CapacityNamespaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *CapacityNamespace, error.

CapacityHostOptions

Go5 lines
type CapacityHostOptions struct {
	Dir		string
	MaxBytes	int64
	MaxNamespaces	int
}

CapacityNamespace

Go3 lines
type CapacityNamespace struct {

}// contains filtered or unexported fields

CapacityNamespace.Snapshot

Go1 line
func (n *CapacityNamespace) Snapshot(ctx context.Context) (CapacitySnapshot, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.

Returns: CapacitySnapshot, error.

CapacityNamespaceOptions

Go5 lines
type CapacityNamespaceOptions struct {
	ID				string
	MaxBytes, RecoveryReserveBytes	int64
	MaxOperations, MaxDependencies	int
}

CapacitySnapshot

Go4 lines
type CapacitySnapshot struct {
	PayloadBytes, RecoveryBytes, ReservedRecoveryBytes, PendingBytes	int64
	Operations								int
}

CaptureCheckpoint

Capture paused writers with a persisted unique request key. Replay retained results before admitting a new capture.

Go1 line
func CaptureCheckpoint(ctx context.Context, registryDir, workspaceID string, request CheckpointRequest) (CheckpointResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
workspaceID string Yes —
request CheckpointRequest Yes —

Returns: CheckpointResult, error.

CapturePrincipal

CapturePrincipal is what a capture from outside the workspace is decided by.

Go4 lines
type CapturePrincipal struct {
	Environment	authority.Authority
	Policy		policy.Source
}

CheckpointArchiveOptions

CheckpointArchiveOptions bounds archive work.

Go6 lines
type CheckpointArchiveOptions struct {
	MaxBytes		int64
	MaxFiles		int64
	IncludeSensitiveFiles	bool
	ExpectedSHA256		string
}

CheckpointArchivePreview

CheckpointArchivePreview describes the verified contents of an archive.

Go13 lines
type CheckpointArchivePreview struct {
	Version		int			`json:"version"`
	PrimaryBucket	string			`json:"primary_bucket,omitempty"`
	Buckets		[]string		`json:"buckets,omitempty"`
	Objects		[]CheckpointObject	`json:"objects,omitempty"`
	CheckpointID	string			`json:"checkpoint_id"`
	WorkspaceID	string			`json:"workspace_id"`
	ParentID	string			`json:"parent_checkpoint_id,omitempty"`
	Files		[]CheckpointFile	`json:"files"`
	Excluded	[]string		`json:"excluded_sensitive_paths,omitempty"`
	SensitivePaths	[]string		`json:"sensitive_paths,omitempty"`
	Bytes		int64			`json:"bytes"`
}

CheckpointBucketChange

Go4 lines
type CheckpointBucketChange struct {
	Bucket	string	`json:"bucket"`
	Kind	string	`json:"kind"`
}

CheckpointChange

Go6 lines
type CheckpointChange struct {
	Path	string		`json:"path"`
	Kind	string		`json:"kind"`
	From	*CheckpointFile	`json:"from,omitempty"`
	To	*CheckpointFile	`json:"to,omitempty"`
}

CheckpointError

Go8 lines
type CheckpointError struct {
	Code		string	`json:"code"`
	Phase		string	`json:"phase"`
	Attempts	int	`json:"attempts"`
	Retryable	bool	`json:"retryable"`
	Outcome		string	`json:"outcome"`
	Err		error	`json:"-"`
}

CheckpointError.Error

Go1 line
func (e *CheckpointError) Error() string

Returns: string.

CheckpointError.Unwrap

Go1 line
func (e *CheckpointError) Unwrap() error

Returns: error.

CheckpointFile

Go6 lines
type CheckpointFile struct {
	Path	string	`json:"path"`
	Size	int64	`json:"size"`
	Mode	uint32	`json:"mode"`
	SHA256	string	`json:"sha256"`
}

CheckpointHold

Go5 lines
type CheckpointHold struct {
	ID		string		`json:"id"`
	Owner		string		`json:"owner"`
	ExpiresAt	time.Time	`json:"expires_at,omitempty"`
}

CheckpointInfo

Go11 lines
type CheckpointInfo struct {
	Version		int		`json:"version,omitempty"`
	Objects		int64		`json:"objects,omitempty"`
	ID		string		`json:"id"`
	WorkspaceID	string		`json:"workspace_id"`
	ParentID	string		`json:"parent_id"`
	Created		time.Time	`json:"created"`
	Files		int64		`json:"files"`
	Bytes		int64		`json:"bytes"`
	Excluded	[]string	`json:"excluded"`
}

CheckpointManifest

Go15 lines
type CheckpointManifest struct {
	Provenance		*CheckpointProvenance	`json:"provenance,omitempty"`
	PrimaryBucket		string			`json:"primary_bucket,omitempty"`
	Buckets			[]string		`json:"buckets,omitempty"`
	Objects			[]CheckpointObject	`json:"objects,omitempty"`
	Payloads		[]CheckpointFile	`json:"payloads,omitempty"`
	WorkingDirectory	string			`json:"working_directory,omitempty"`
	Version			int			`json:"version"`
	ID			string			`json:"id"`
	WorkspaceID		string			`json:"workspace_id"`
	ParentID		string			`json:"parent_id,omitempty"`
	Created			time.Time		`json:"created"`
	Files			[]CheckpointFile	`json:"files"`
	Excluded		[]string		`json:"excluded,omitempty"`
}

CheckpointObject

CheckpointObject describes logical object state, independent of backend paths.

Go12 lines
type CheckpointObject struct {
	Bucket			string			`json:"bucket"`
	Key			string			`json:"key"`
	Payload			string			`json:"payload"`
	Size			int64			`json:"size"`
	SHA256			string			`json:"sha256"`
	ContentType		string			`json:"content_type"`
	Metadata		map[string]string	`json:"metadata,omitempty"`
	ChecksumAlgorithm	string			`json:"checksum_algorithm,omitempty"`
	ChecksumValue		string			`json:"checksum_value,omitempty"`
	ChecksumType		string			`json:"checksum_type,omitempty"`
}

CheckpointObjectChange

Go7 lines
type CheckpointObjectChange struct {
	Bucket	string			`json:"bucket"`
	Key	string			`json:"key"`
	Kind	string			`json:"kind"`
	From	*CheckpointObject	`json:"from,omitempty"`
	To	*CheckpointObject	`json:"to,omitempty"`
}

CheckpointOf

CheckpointOf captures a checkpoint of a workspace that another process may be using right now: the operation an orchestrator needs and could not perform, since the answer to "what has it done so far?" must not require the agent to stop.

Go1 line
func CheckpointOf(ctx context.Context, registryDir, id string, options CheckpointOptions) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
options CheckpointOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointInfo, error.

CheckpointOfAuthorized

CheckpointOfAuthorized is CheckpointOf with its principal named.

Go1 line
func CheckpointOfAuthorized(ctx context.Context, registryDir, id string, options CheckpointOptions, principal CapturePrincipal) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
options CheckpointOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
principal CapturePrincipal Yes —

Returns: CheckpointInfo, error.

CheckpointOptions

Go7 lines
type CheckpointOptions struct {
	PortableObjects		bool	`json:"portable_objects,omitempty"`
	ParentID		string	`json:"parent_id,omitempty"`
	MaxBytes		int64	`json:"max_bytes,omitempty"`
	MaxFiles		int64	`json:"max_files,omitempty"`
	IncludeSensitiveFiles	bool	`json:"include_sensitive_files,omitempty"`
}

CheckpointProvenance

Go4 lines
type CheckpointProvenance struct {
	Repositories		[]CheckpointRepository	`json:"repositories,omitempty"`
	OriginCheckpointID	string			`json:"origin_checkpoint_id,omitempty"`
}

CheckpointReadDirectory

Go5 lines
type CheckpointReadDirectory struct {
	Entries	[]WorkspaceReadEntry
	Offset	int
	Total	int
}

CheckpointReader

Go3 lines
type CheckpointReader struct {

}// contains filtered or unexported fields

CheckpointReader.Close

Release this handle. Do not submit new operations after closing it.

Go1 line
func (r *CheckpointReader) Close() error

Returns: error.

CheckpointReader.ReadDirectory

Go1 line
func (r *CheckpointReader) ReadDirectory(ctx context.Context, path string, offset, limit int) (CheckpointReadDirectory, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.
offset int Yes —
limit int Yes — Maximum results per page; limits and defaults depend on the listing API.

Returns: CheckpointReadDirectory, error.

CheckpointReader.ReadFile

Go1 line
func (r *CheckpointReader) ReadFile(ctx context.Context, path string) (CheckpointReadResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.

Returns: CheckpointReadResult, error.

CheckpointReader.ReadRange

Read byte offsets from start inclusive to end exclusive.

Go1 line
func (r *CheckpointReader) ReadRange(ctx context.Context, path string, offset, length int64) (CheckpointReadResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.
offset int64 Yes —
length int64 Yes —

Returns: CheckpointReadResult, error.

CheckpointReader.Reference

Go1 line
func (r *CheckpointReader) Reference() CheckpointReadReference

Returns: CheckpointReadReference.

CheckpointReaderOptions

Go8 lines
type CheckpointReaderOptions struct {
	RegistryDir	string
	WorkspaceID	string
	CheckpointID	string
	ReadRoots	[]string
	Lifetime	time.Duration
	MaxVerifyBytes	int64
}

CheckpointReadReference

Go9 lines
type CheckpointReadReference struct {
	WorkspaceID	string
	CheckpointID	string
	Version		int
	ManifestSHA256	string
	CreatedAt	time.Time
	ExpiresAt	time.Time
	ReadRoots	[]string
}

CheckpointReadResult

Go7 lines
type CheckpointReadResult struct {
	Path	string
	Data	[]byte
	Offset	int64
	Size	int64
	SHA256	string
}

CheckpointRepository

Go5 lines
type CheckpointRepository struct {
	Destination	string	`json:"destination"`
	Commit		string	`json:"commit"`
	SourceLabel	string	`json:"source_label,omitempty"`
}

CheckpointRequest

Go5 lines
type CheckpointRequest struct {
	Hold	*CheckpointHold		`json:"hold,omitempty"`
	Key	string			`json:"request_key"`
	Options	CheckpointOptions	`json:"options"`
}

CheckpointResult

Go5 lines
type CheckpointResult struct {
	Checkpoint	CheckpointInfo	`json:"checkpoint"`
	Replayed	bool		`json:"replayed"`
	Outcome		string		`json:"outcome"`
}

Collect

Collect reclaims workspaces that are past their TTL and provably unused.

Go1 line
func Collect(options CollectOptions) ([]CollectResult, error)
Parameter Type Required Default Meaning
options CollectOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: []CollectResult, error.

CollectOptions

CollectOptions configures a sweep.

Go5 lines
type CollectOptions struct {
	RegistryDir	string
	Team		string
	Now		func() time.Time
}

CollectResult

CollectResult is one workspace a sweep considered, and what it did about it.

Go6 lines
type CollectResult struct {
	ID	string	`json:"id"`
	Dir	string	`json:"dir"`
	Removed	bool	`json:"removed"`
	Reason	string	`json:"reason"`
}

CompareCheckpoints

Go1 line
func CompareCheckpoints(registryDir, fromID, toID string) ([]CheckpointChange, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
fromID string Yes —
toID string Yes —

Returns: []CheckpointChange, error.

ComparePortableCheckpoints

Go1 line
func ComparePortableCheckpoints(registryDir, fromID, toID string) (PortableCheckpointDiff, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
fromID string Yes —
toID string Yes —

Returns: PortableCheckpointDiff, error.

ConditionalWriteStore

ConditionalWriteStore opts into atomic IfMatch/IfNoneMatch enforcement.

Go1 line
type ConditionalWriteStore interface{ SupportsConditionalWrites() bool }

CopyStore

Go3 lines
type CopyStore interface {
	CopyObject(context.Context, string, string, string, string) (Object, error)
}

CreateDelta

CreateDelta describes the difference between two checkpoints in one registry.

Go1 line
func CreateDelta(ctx context.Context, registryDir, baseID, targetID string, options DeltaOptions) (*DeltaDocument, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
baseID string Yes — Checkpoint identity that must match the delta's named base.
targetID string Yes —
options DeltaOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *DeltaDocument, error.

DecodeDelta

DecodeDelta parses a transported delta.

Go1 line
func DecodeDelta(raw []byte) (*DeltaDocument, error)
Parameter Type Required Default Meaning
raw []byte Yes —

Returns: *DeltaDocument, error.

DefaultWorkspaceRegistryDir

DefaultWorkspaceRegistryDir reports where this host stores local workspace references.

Go1 line
func DefaultWorkspaceRegistryDir() (string, error)

DefaultWorkspaceRegistryDirForTeam

DefaultWorkspaceRegistryDirForTeam reports where a named team's workspace references live on this host.

Go1 line
func DefaultWorkspaceRegistryDirForTeam(team string) (string, error)
Parameter Type Required Default Meaning
team string Yes — Registry team partition; it is not an authorization identity.

Returns: string, error.

DeleteCheckpoint

DeleteCheckpoint removes a retained checkpoint and its local replay receipt.

Go1 line
func DeleteCheckpoint(ctx context.Context, registryDir, id string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: error.

DeltaChange

DeltaChange is one path's difference.

Go6 lines
type DeltaChange struct {
	Path	string		`json:"path"`
	Kind	string		`json:"kind"`
	From	*CheckpointFile	`json:"from,omitempty"`
	To	*CheckpointFile	`json:"to,omitempty"`
}

DeltaChangeAdded

Change kinds, matching what the checkpoint diff already emits.

Go1 line
const DeltaChangeAdded = "added"

DeltaChangeChanged

Change kinds, matching what the checkpoint diff already emits.

Go1 line
const DeltaChangeChanged = "changed"

DeltaChangeDeleted

Change kinds, matching what the checkpoint diff already emits.

Go1 line
const DeltaChangeDeleted = "deleted"

DeltaDocument

DeltaDocument is the transferable form.

Go11 lines
type DeltaDocument struct {
	Version			int			`json:"version"`
	BaseID			string			`json:"base_id"`
	TargetID		string			`json:"target_id"`
	Created			time.Time		`json:"created"`
	Changes			[]DeltaChange		`json:"changes"`
	Files			int64			`json:"files"`
	Bytes			int64			`json:"bytes"`
	Content			map[string][]byte	`json:"content,omitempty"`
	IncludeSensitive	bool			`json:"include_sensitive,omitempty"`
}

DeltaDocumentDigest

DeltaDocumentDigest is the digest a sender publishes for a document and a receiver checks it against.

Go1 line
func DeltaDocumentDigest(encoded []byte) string
Parameter Type Required Default Meaning
encoded []byte Yes —

Returns: string.

DeltaOptions

DeltaOptions bounds the work a delta may describe.

Go7 lines
type DeltaOptions struct {
	MaxBytes		int64
	MaxFiles		int64
	IncludeSensitive	bool
	Encoded			[]byte
	ExpectSHA256		string
}

DeltaVersion

DeltaVersion is the delta document's format version.

Go1 line
const DeltaVersion = 1

DestroyRegisteredWorkspace

DestroyRegisteredWorkspace is an explicit host-administrative operation over a trusted registry.

Go1 line
func DestroyRegisteredWorkspace(ctx context.Context, registryDir, id string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: error.

DiscardRecoveryHold

Go1 line
func DiscardRecoveryHold(ctx context.Context, registryDir, id, owner string) (RecoveryHold, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
owner string Yes — Identity that owns the durable recovery hold.

Returns: RecoveryHold, error.

EncodeDelta

EncodeDelta serializes a delta, including its content, for transport.

Go1 line
func EncodeDelta(delta *DeltaDocument) ([]byte, error)
Parameter Type Required Default Meaning
delta *DeltaDocument Yes — Verified change document to encode or apply.

Returns: []byte, error.

EnvironmentDestroy

Go1 line
const EnvironmentDestroy Operation = "environment.destroy"

EnvironmentPromote

Go1 line
const EnvironmentPromote Operation = "environment.promote"

EnvironmentReset

Go1 line
const EnvironmentReset Operation = "environment.reset"

ErrBucketExists

Go1 line
var ErrBucketExists = embedded.ErrBucketExists

ErrBucketNotEmpty

Go1 line
var ErrBucketNotEmpty = embedded.ErrBucketNotEmpty

ErrBucketNotFound

Go1 line
var ErrBucketNotFound = embedded.ErrBucketNotFound

ErrCapacityConflict

Go1 line
var ErrCapacityConflict = capacity.ErrConflict

ErrCapacityFull

Go1 line
var ErrCapacityFull = capacity.ErrFull

ErrCapacityInvalid

Go1 line
var ErrCapacityInvalid = capacity.ErrInvalid

ErrCapacityUnknown

Go1 line
var ErrCapacityUnknown = capacity.ErrUnknown

ErrCheckpointInUse

Go1 line
var ErrCheckpointInUse = workspace.ErrCheckpointInUse

ErrCheckpointReadClosed

Go1 line
var ErrCheckpointReadClosed = errors.New("stow: checkpoint reader is closed")

ErrCheckpointReadExpired

Go1 line
var ErrCheckpointReadExpired = errors.New("stow: checkpoint reader expired")

ErrCheckpointReadTooLarge

Go1 line
var ErrCheckpointReadTooLarge = errors.New("stow: checkpoint resource is too large")

ErrCheckpointReadUnavailable

Go1 line
var ErrCheckpointReadUnavailable = errors.New("stow: checkpoint resource is unavailable")

ErrClosed

Go1 line
var ErrClosed = embedded.ErrClosed

ErrConditionalWritesUnsupported

Go1 line
var ErrConditionalWritesUnsupported = embedded.ErrConditionalWritesUnsupported

ErrDeltaConflict

ErrDeltaConflict reports that a delta could not be applied because the target is not where the delta was written to be applied.

Go1 line
var ErrDeltaConflict = errors.New("delta target has diverged from the delta's base")

ErrDeltaDigestMismatch

ErrDeltaDigestMismatch reports that a delta document does not hash to the digest the sender published for it.

Go1 line
var ErrDeltaDigestMismatch = errors.New("delta document does not match the digest the sender published")

ErrDeltaTooLarge

ErrDeltaTooLarge reports a delta document whose content is over MaxDeltaBytes.

Go1 line
var ErrDeltaTooLarge = errors.New("delta document is larger than the format allows")

ErrDeltaVersionUnsupported

ErrDeltaVersionUnsupported reports a delta whose format version this build does not speak.

Go1 line
var ErrDeltaVersionUnsupported = errors.New("delta document version is not supported")

ErrGuardedSavesUnsupported

Go1 line
var ErrGuardedSavesUnsupported = embedded.ErrGuardedSavesUnsupported

ErrHandoffDigestMismatch

Go1 line
var ErrHandoffDigestMismatch = errors.New("handoff archive does not match the published digest")

ErrInvalidBucket

Go1 line
var ErrInvalidBucket = embedded.ErrInvalidBucket

ErrInvalidKey

Go1 line
var ErrInvalidKey = embedded.ErrInvalidKey

ErrInvalidListLimit

Go1 line
var ErrInvalidListLimit = embedded.ErrInvalidListLimit

ErrInvalidRecoveryHold

Go1 line
var ErrInvalidRecoveryHold = embedded.ErrInvalidRecoveryHold

ErrInvalidSaveCondition

Go1 line
var ErrInvalidSaveCondition = embedded.ErrInvalidSaveCondition

ErrInvalidSaveRequest

Go1 line
var ErrInvalidSaveRequest = embedded.ErrInvalidSaveRequest

ErrMutationCommitted

Go1 line
var ErrMutationCommitted = embedded.ErrMutationCommitted

ErrNotAuthorized

ErrNotAuthorized is returned for a refused operation.

Go4 lines
type ErrNotAuthorized struct {
	Operation	Operation
	Authority	Authority
}

ErrNotAuthorized.Error

Go1 line
func (e *ErrNotAuthorized) Error() string

Returns: string.

ErrObjectNotFound

Go1 line
var ErrObjectNotFound = embedded.ErrObjectNotFound

ErrPreconditionFailed

Go1 line
var ErrPreconditionFailed = embedded.ErrPreconditionFailed

ErrQuotaExceeded

Go1 line
var ErrQuotaExceeded = embedded.ErrQuotaExceeded

ErrRecoveryHeld

Go1 line
var ErrRecoveryHeld = storage.ErrRecoveryHeld

ErrRecoveryHoldConflict

Go1 line
var ErrRecoveryHoldConflict = workspace.ErrRecoveryHoldConflict

ErrRecoveryHoldCorrupt

Go1 line
var ErrRecoveryHoldCorrupt = workspace.ErrRecoveryHoldCorrupt

ErrRecoveryHoldFull

Go1 line
var ErrRecoveryHoldFull = workspace.ErrRecoveryHoldFull

ErrRecoveryHoldNotFound

Go1 line
var ErrRecoveryHoldNotFound = workspace.ErrRecoveryHoldNotFound

ErrRecoveryHoldsUnsupported

Go1 line
var ErrRecoveryHoldsUnsupported = embedded.ErrRecoveryHoldsUnsupported

ErrSaveConflict

Go1 line
var ErrSaveConflict = embedded.ErrSaveConflict

ErrSaveRequestConflict

Go1 line
var ErrSaveRequestConflict = embedded.ErrSaveRequestConflict

ErrSaveRequestFull

Go1 line
var ErrSaveRequestFull = embedded.ErrSaveRequestFull

ErrSaveRequestNotCommitted

Go1 line
var ErrSaveRequestNotCommitted = embedded.ErrSaveRequestNotCommitted

ErrSaveRequestNotFound

Go1 line
var ErrSaveRequestNotFound = embedded.ErrSaveRequestNotFound

ErrSaveRequestsUnsupported

Go1 line
var ErrSaveRequestsUnsupported = embedded.ErrSaveRequestsUnsupported

ErrSaveRequestUnknown

Go1 line
var ErrSaveRequestUnknown = embedded.ErrSaveRequestUnknown

ErrUnsupportedBackend

Go1 line
var ErrUnsupportedBackend = embedded.ErrUnsupportedBackend

ErrWorkspaceEditorClosed

Go1 line
var ErrWorkspaceEditorClosed = errors.New("stow: workspace file editor is closed")

ErrWorkspaceEditorUnavailable

Go1 line
var ErrWorkspaceEditorUnavailable = errors.New("stow: workspace file editor unavailable")

ErrWorkspaceObservationFull

Go1 line
var ErrWorkspaceObservationFull = errors.New("stow: workspace file observation capacity reached")

ErrWorkspaceObservationInvalid

Go1 line
var ErrWorkspaceObservationInvalid = errors.New("stow: workspace file observation is invalid or expired")

ErrWorkspaceReadChanged

Go1 line
var ErrWorkspaceReadChanged = errors.New("stow: workspace resource changed during read")

ErrWorkspaceReaderClosed

Go1 line
var ErrWorkspaceReaderClosed = errors.New("stow: workspace reader is closed")

ErrWorkspaceReadTooLarge

Go1 line
var ErrWorkspaceReadTooLarge = errors.New("stow: workspace resource is too large")

ErrWorkspaceReadUnavailable

Go1 line
var ErrWorkspaceReadUnavailable = errors.New("stow: workspace resource is unavailable")

ExportCheckpoint

ExportCheckpoint writes a portable gzip-compressed tar archive.

Go1 line
func ExportCheckpoint(ctx context.Context, registryDir, id string, output io.Writer, options CheckpointArchiveOptions) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
output io.Writer Yes — Destination path for the transfer document or archive.
options CheckpointArchiveOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: error.

ExportHandoff

ExportHandoff creates a new directory containing a self-contained portable bundle.

Go1 line
func ExportHandoff(ctx context.Context, options HandoffExportOptions) (Handoff, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
options HandoffExportOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Handoff, error.

FilesystemOptions

Go5 lines
type FilesystemOptions struct {
	Dir		string
	Options		Options
	Namespace	*CapacityNamespace
}

GetRegistryPolicy

Go1 line
func GetRegistryPolicy(registryDir string) (RegistryPolicy, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.

Returns: RegistryPolicy, error.

GitRepositoryInput

GitRepositoryInput fetches one local repository commit into a fresh shallow repository and checks it out detached.

Go5 lines
type GitRepositoryInput struct {
	Source		string	`json:"source"`
	Destination	string	`json:"destination"`
	Ref		string	`json:"ref"`
}

Handoff

Go8 lines
type Handoff struct {
	Version		int		`json:"version"`
	WorkspaceID	string		`json:"workspace_id"`
	CheckpointID	string		`json:"checkpoint_id,omitempty"`
	RegistryDir	string		`json:"registry_dir,omitempty"`
	Team		string		`json:"team,omitempty"`
	Archive		*HandoffArchive	`json:"archive,omitempty"`
}

HandoffArchive

Go6 lines
type HandoffArchive struct {
	Path	string	`json:"path"`
	SHA256	string	`json:"sha256"`
	Bytes	int64	`json:"bytes"`
	Files	int64	`json:"files"`
}

HandoffError

Go5 lines
type HandoffError struct {
	BundleDir	string
	Outcome		string
	Err		error
}

HandoffError.Error

Go1 line
func (e *HandoffError) Error() string

Returns: string.

HandoffError.Unwrap

Go1 line
func (e *HandoffError) Unwrap() error

Returns: error.

HandoffExportOptions

Go7 lines
type HandoffExportOptions struct {
	RegistryDir	string
	WorkspaceID	string
	CheckpointID	string
	BundleDir	string
	ArchiveOptions	CheckpointArchiveOptions
}

ImportCheckpoint

ImportCheckpoint validates a portable checkpoint archive in a private staging directory and atomically publishes it only after every path and digest passes.

Go1 line
func ImportCheckpoint(ctx context.Context, registryDir string, input io.Reader, options CheckpointArchiveOptions) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
input io.Reader Yes —
options CheckpointArchiveOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointInfo, error.

ImportHandoff

ImportHandoff verifies identity and a private copy of the received archive before import.

Go1 line
func ImportHandoff(ctx context.Context, path, registryDir string, document Handoff, options CheckpointArchiveOptions) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.
registryDir string Yes — Native registry directory for workspace metadata.
document Handoff Yes — Versioned handoff or delta document.
options CheckpointArchiveOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointInfo, error.

List

List returns the workspaces this machine knows about, quietest first.

Go1 line
func List(options ListWorkspacesOptions) (WorkspaceListing, error)
Parameter Type Required Default Meaning
options ListWorkspacesOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: WorkspaceListing, error.

ListOptions

Go6 lines
type ListOptions struct {
	Prefix		string
	Delimiter	string
	Cursor		string
	Limit		int
}

ListRecoveryHolds

Go1 line
func ListRecoveryHolds(ctx context.Context, registryDir string, query RecoveryHoldQuery) (RecoveryHoldPage, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
query RecoveryHoldQuery Yes —

Returns: RecoveryHoldPage, error.

ListWorkspacesOptions

ListWorkspacesOptions bounds a workspace listing.

Go5 lines
type ListWorkspacesOptions struct {
	RegistryDir	string
	Team		string
	Now		time.Time
}

LoadCheckpoint

Go1 line
func LoadCheckpoint(registryDir, id string) (CheckpointManifest, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: CheckpointManifest, error.

LookupWorkspace

LookupWorkspace reads one workspace's registry entry: no process, no claims, no writes.

Go1 line
func LookupWorkspace(registryDir, id string) (WorkspaceReference, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: WorkspaceReference, error.

MaxDeltaBytes

MaxDeltaBytes is the largest content a delta document may declare, on the way out and on the way in.

Go1 line
const MaxDeltaBytes int64 = 16 << 20

MaxRecoveryHoldBytes

Go1 line
const MaxRecoveryHoldBytes = 2 << 20

MaxRecoveryHoldPeakBytes

Go1 line
const MaxRecoveryHoldPeakBytes = 2 * MaxRecoveryHoldBytes

MaxRecoveryHolds

Go1 line
const MaxRecoveryHolds = 256

MaxRecoveryReferences

Go1 line
const MaxRecoveryReferences = 32

MultipartOptions

MultipartOptions are the object properties a multipart upload fixes at initiation.

Go4 lines
type MultipartOptions struct {
	ContentType	string
	Metadata	map[string]string
}

MultipartStore

MultipartStore is the optional extension: a store that can stream an object larger than memory.

Go9 lines
type MultipartStore interface {
	CreateMultipartUpload(ctx context.Context, bucket, key string, options MultipartOptions) (MultipartUpload, error)
	UploadPart(ctx context.Context, uploadID string, partNumber int, data []byte) (Part, error)
	CompleteMultipartUpload(ctx context.Context, uploadID string, parts []Part) (Object, error)
	AbortMultipartUpload(ctx context.Context, uploadID string) error
	GetMultipartUpload(ctx context.Context, uploadID string) (MultipartUpload, error)
	ListParts(ctx context.Context, uploadID string) ([]Part, error)
	ListMultipartUploads(ctx context.Context, bucket string) ([]MultipartUpload, error)
}

MultipartUpload

MultipartUpload is an in-flight upload.

Go8 lines
type MultipartUpload struct {
	UploadID	string
	Bucket		string
	Key		string
	Initiated	time.Time
	ContentType	string
	Metadata	map[string]string
}

Object

Go10 lines
type Object struct {
	Bucket		string
	Key		string
	Data		[]byte
	Size		int64
	ETag		string
	ContentType	string
	Metadata	map[string]string
	LastModified	time.Time
}

ObjectDelete

Go1 line
const ObjectDelete Operation = "object.delete"

ObjectList

Go1 line
const ObjectList Operation = "object.list"

ObjectPage

Go6 lines
type ObjectPage struct {
	Objects		[]Object
	Truncated	bool
	NextCursor	string
	CommonPrefixes	[]string
}

ObjectRange

Go4 lines
type ObjectRange struct {
	Offset	int64
	Length	int64
}

ObjectRead

Go1 line
const ObjectRead Operation = "object.read"

ObjectRecoveryHoldOptions

Go4 lines
type ObjectRecoveryHoldOptions struct {
	ID, Owner	string
	Objects		[]ObjectRecoveryReference
}

ObjectRecoveryReference

Go4 lines
type ObjectRecoveryReference struct {
	Bucket, Key	string
	Condition	SaveCondition
}

ObjectWrite

Go1 line
const ObjectWrite Operation = "object.write"

Open

Open a handle. Retain it until operations finish, then close it.

Go1 line
func Open(options Options) (*Runtime, error)
Parameter Type Required Default Meaning
options Options Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *Runtime, error.

OpenAdapter

Open an embedded runtime over a persistence.Adapter. The adapter supplies get, put, list, delete and conditional put; multipart is not part of that contract and stays unsupported.

Go1 line
func OpenAdapter(options Options, backend persistence.Adapter, buckets ...string) (*Runtime, error)
Parameter Type Required Default Meaning
options Options Yes — Configuration for this operation; the parameter type lists the accepted settings.
backend persistence.Adapter Yes — Storage implementation selected or reported by this handle.
buckets ...string Yes — Buckets to create before startup resolves, or buckets returned by inspection.

Returns: *Runtime, error.

OpenCapacityHost

Go1 line
func OpenCapacityHost(options CapacityHostOptions) (*CapacityHost, error)
Parameter Type Required Default Meaning
options CapacityHostOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *CapacityHost, error.

OpenCheckpointReader

Go1 line
func OpenCheckpointReader(ctx context.Context, options CheckpointReaderOptions) (*CheckpointReader, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
options CheckpointReaderOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *CheckpointReader, error.

OpenFilesystem

OpenFilesystem owns one exclusively locked durable directory; Reset is unavailable.

Go1 line
func OpenFilesystem(options FilesystemOptions) (*Runtime, error)
Parameter Type Required Default Meaning
options FilesystemOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *Runtime, error.

OpenWorkspace

OpenWorkspace opens options.Dir without a process, listener or ambient credentials.

Go1 line
func OpenWorkspace(options WorkspaceOptions) (*Workspace, error)
Parameter Type Required Default Meaning
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *Workspace, error.

OpenWorkspaceReader

OpenWorkspaceReader attaches to an existing workspace without opening a writer session or changing its manifest, index, registry entry or workspace identity.

Go1 line
func OpenWorkspaceReader(options WorkspaceReaderOptions) (*WorkspaceReader, error)
Parameter Type Required Default Meaning
options WorkspaceReaderOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *WorkspaceReader, error.

Operation

Operation is a single permission.

Go1 line
type Operation string

Options

Go8 lines
type Options struct {
	Backend			Backend
	MaxBytes		int64
	MaxObjects		int64
	MaxMultipartUploads	int64
	Store			Store
	Authority		*Authority
}

Part

Part is one uploaded piece of a multipart upload.

Go5 lines
type Part struct {
	PartNumber	int
	ETag		string
	Size		int64
}

PortableCheckpointDiff

Go6 lines
type PortableCheckpointDiff struct {
	Version	int				`json:"version"`
	Files	[]CheckpointChange		`json:"files"`
	Buckets	[]CheckpointBucketChange	`json:"buckets"`
	Objects	[]CheckpointObjectChange	`json:"objects"`
}

PreparedRepository

PreparedRepository records the immutable revision selected for one input.

Go6 lines
type PreparedRepository struct {
	Source		string	`json:"source"`
	Destination	string	`json:"destination"`
	Ref		string	`json:"ref"`
	Commit		string	`json:"commit"`
}

PreparedWorkspace

PreparedWorkspace is the ready-to-launch result.

Go11 lines
type PreparedWorkspace struct {
	Workspace		*Workspace
	WorkingDirectory	string
	SeededBytes		int64
	SeededObjects		int64
	BaseIdentity		string
	Excluded		[]string
	Repositories		[]PreparedRepository
	RegistryEntries		int64
	MaxWorkspaces		int64
}

PrepareOptions

PrepareOptions describes a local, deterministic workspace seed.

Go9 lines
type PrepareOptions struct {
	WorkspaceOptions
	WorkingDirectory	string			`json:"working_directory,omitempty"`
	Inputs			[]WorkspaceInput	`json:"inputs,omitempty"`
	Repositories		[]GitRepositoryInput	`json:"repositories,omitempty"`
	IncludeSensitiveInputs	bool			`json:"include_sensitive_inputs,omitempty"`
	SensitivePaths		string			`json:"sensitive_paths,omitempty"`
	MaxWorkspaces		int64			`json:"max_workspaces,omitempty"`
}

PrepareWorkspace

PrepareWorkspace creates a Stow-owned workspace, stages declared local files and selected Git refs, checks the seed against effective runtime limits, then returns the directory an agent can use.

Go1 line
func PrepareWorkspace(options PrepareOptions) (_ *PreparedWorkspace, resultErr error)
Parameter Type Required Default Meaning
options PrepareOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *PreparedWorkspace, error.

PreviewCheckpointArchive

PreviewCheckpointArchive validates archive structure, file paths, limits, content digests, and the gzip trailer without extracting or publishing files.

Go1 line
func PreviewCheckpointArchive(ctx context.Context, input io.Reader, options CheckpointArchiveOptions) (CheckpointArchivePreview, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
input io.Reader Yes —
options CheckpointArchiveOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointArchivePreview, error.

Prune

Prune removes registry entries whose workspace directory no longer exists.

Go1 line
func Prune(options PruneOptions) ([]PruneResult, error)
Parameter Type Required Default Meaning
options PruneOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: []PruneResult, error.

PruneOptions

PruneOptions bounds a prune.

Go5 lines
type PruneOptions struct {
	RegistryDir	string
	Team		string
	IncludeAdopted	bool
}

PruneResult

PruneResult is one registry entry prune considered, and what it did about it.

Go6 lines
type PruneResult struct {
	ID	string	`json:"id"`
	Dir	string	`json:"dir"`
	Removed	bool	`json:"removed"`
	Reason	string	`json:"reason"`
}

PutOptions

Go6 lines
type PutOptions struct {
	ContentType	string
	Metadata	map[string]string
	IfMatch		string
	IfNoneMatch	string
}

RangeStore

Go3 lines
type RangeStore interface {
	OpenObjectRange(context.Context, string, string, ObjectRange) (io.ReadCloser, Object, error)
}

ReadCheckpointFile

ReadCheckpointFile reads one file's bytes out of a published checkpoint, verifying the digest the manifest recorded.

Go1 line
func ReadCheckpointFile(registryDir, checkpointID, path string) ([]byte, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
checkpointID string Yes —
path string Yes — Local path selected for this file or archive operation.

Returns: []byte, error.

ReadHandoff

Go1 line
func ReadHandoff(path string) (Handoff, error)
Parameter Type Required Default Meaning
path string Yes — Local path selected for this file or archive operation.

Returns: Handoff, error.

ReadHandoffReader

Go1 line
func ReadHandoffReader(reader io.Reader) (Handoff, error)
Parameter Type Required Default Meaning
reader io.Reader Yes —

Returns: Handoff, error.

ReadOnly

ReadOnly returns an Authority that can read and list but change nothing.

Go1 line
func ReadOnly() Authority

ReadWrite

ReadWrite returns an Authority for local work with no reach outside the environment.

Go1 line
func ReadWrite() Authority

RecoveryHold

Go7 lines
type RecoveryHold struct {
	RecoveryHoldRequest
	Meaning		string		`json:"meaning"`
	State		string		`json:"state"`
	Created		time.Time	`json:"created"`
	FinishedAt	time.Time	`json:"finished_at,omitempty"`
}

RecoveryHoldPage

Go6 lines
type RecoveryHoldPage struct {
	Holds			[]RecoveryHold	`json:"holds"`
	NextCursor		string		`json:"next_cursor,omitempty"`
	ReservedBytes		int64		`json:"reserved_bytes"`
	PeakReservedBytes	int64		`json:"peak_reserved_bytes"`
}

RecoveryHoldQuery

Go6 lines
type RecoveryHoldQuery struct {
	Cursor		string
	Limit		int
	WorkspaceID	string
	IncludeFinished	bool
}

RecoveryHoldRequest

Go6 lines
type RecoveryHoldRequest struct {
	ID		string			`json:"id"`
	Owner		string			`json:"owner"`
	References	[]RecoveryReference	`json:"references"`
	ExpiresAt	time.Time		`json:"expires_at,omitempty"`
}

RecoveryReference

Go4 lines
type RecoveryReference struct {
	WorkspaceID	string	`json:"workspace_id"`
	CheckpointID	string	`json:"checkpoint_id,omitempty"`
}

RegistryPolicy

Go6 lines
type RegistryPolicy struct {
	Version			int	`json:"version"`
	MaxWorkspaces		int64	`json:"max_workspaces"`
	MaxCheckpoints		int64	`json:"max_checkpoints"`
	MaxCheckpointBytes	int64	`json:"max_checkpoint_bytes"`
}

RegistryPolicy.Validate

Go1 line
func (p RegistryPolicy) Validate() error

Returns: error.

ReleaseRecoveryHold

Go1 line
func ReleaseRecoveryHold(ctx context.Context, registryDir, id, owner string) (RecoveryHold, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
owner string Yes — Identity that owns the durable recovery hold.

Returns: RecoveryHold, error.

ReplacementCondition

Request unconditional replacement while preserving authorization and quota checks.

Go1 line
func ReplacementCondition() SaveCondition

ResolveCheckpoint

Resolve an existing capture request without making another checkpoint.

Go1 line
func ResolveCheckpoint(ctx context.Context, registryDir, workspaceID string, request CheckpointRequest) (CheckpointResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
registryDir string Yes — Native registry directory for workspace metadata.
workspaceID string Yes —
request CheckpointRequest Yes —

Returns: CheckpointResult, error.

ResolveRegistryDir

ResolveRegistryDir is the one rule for where a workspace's metadata lives.

Go1 line
func ResolveRegistryDir(dir, team string) (string, error)
Parameter Type Required Default Meaning
dir string Yes —
team string Yes — Registry team partition; it is not an authorization identity.

Returns: string, error.

RestoreCheckpoint

Go1 line
func RestoreCheckpoint(registryDir, id string, options WorkspaceOptions) (*Workspace, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *Workspace, error.

RestoreCheckpointWithGit

RestoreCheckpointWithGit rebuilds repository metadata from explicit local sources.

Go1 line
func RestoreCheckpointWithGit(registryDir, id string, options WorkspaceOptions, sources []GitRepositoryInput) (*Workspace, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
sources []GitRepositoryInput Yes —

Returns: *Workspace, error.

Resume

Resume reopens a workspace by the identity it was given when it was created.

Go1 line
func Resume(id string) (*Workspace, error)
Parameter Type Required Default Meaning
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: *Workspace, error.

ResumeIn

ResumeIn is Resume against a chosen registry.

Go1 line
func ResumeIn(registryDir, id string) (*Workspace, error)
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: *Workspace, error.

ResumeWith

ResumeWith is Resume with options, chiefly so the registry location and the clock can be chosen.

Go1 line
func ResumeWith(options WorkspaceOptions, id string) (*Workspace, error)
Parameter Type Required Default Meaning
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: *Workspace, error.

ResumeWorkspaceForFileRecovery

ResumeWorkspaceForFileRecovery opens an existing registered workspace for resolving receipts.

Go1 line
func ResumeWorkspaceForFileRecovery(options WorkspaceOptions, id string) (*Workspace, error)
Parameter Type Required Default Meaning
options WorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.

Returns: *Workspace, error.

Runtime

Go3 lines
type Runtime struct {

}// contains filtered or unexported fields

Runtime.Authority

Authority reports what this environment permits.

Go1 line
func (r *Runtime) Authority() Authority

Returns: Authority.

Runtime.Authorize

Authorize is the decision for one operation on one resource this Runtime's verbs do not cover.

Go1 line
func (r *Runtime) Authorize(op authority.Operation, res policy.Resource) error
Parameter Type Required Default Meaning
op authority.Operation Yes — Operation whose permission is being checked.
res policy.Resource Yes —

Returns: error.

Runtime.BeginObjectRecoveryHold

BeginObjectRecoveryHold protects observed bytes by refusing their mutation until release.

Go1 line
func (r *Runtime) BeginObjectRecoveryHold(ctx context.Context, options ObjectRecoveryHoldOptions) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
options ObjectRecoveryHoldOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: error.

Runtime.Capabilities

Return the operations and limits supported by this handle.

Go1 line
func (r *Runtime) Capabilities() Capabilities

Returns: Capabilities.

Runtime.Close

Release this handle. Do not submit new operations after closing it.

Go1 line
func (r *Runtime) Close() error

Returns: error.

Runtime.CopyObject

Copy source bytes and metadata to the destination object.

Go1 line
func (r *Runtime) CopyObject(ctx context.Context, sourceBucket, sourceKey, destinationBucket, destinationKey string) (Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
sourceBucket string Yes — Bucket containing the source object.
sourceKey string Yes — Source object key.
destinationBucket string Yes — Bucket that receives the copy.
destinationKey string Yes — Object key that receives the copy.

Returns: Object, error.

Runtime.CreateBucket

Create the named bucket before storing objects.

Go1 line
func (r *Runtime) CreateBucket(ctx context.Context, name string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
name string Yes — Name identifying this bucket, head, protection or error class.

Returns: error.

Runtime.DeleteBucket

Remove an empty bucket; a nonempty bucket is refused.

Go1 line
func (r *Runtime) DeleteBucket(ctx context.Context, name string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
name string Yes — Name identifying this bucket, head, protection or error class.

Returns: error.

Runtime.DeleteObject

Delete the selected object; deleting a missing object is idempotent.

Go1 line
func (r *Runtime) DeleteObject(ctx context.Context, bucket, key string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: error.

Runtime.GetObject

Return complete object bytes and metadata.

Go1 line
func (r *Runtime) GetObject(ctx context.Context, bucket, key string) (Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: Object, error.

Runtime.HeadObject

Return object metadata without reading the body into the result.

Go1 line
func (r *Runtime) HeadObject(ctx context.Context, bucket, key string) (Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: Object, error.

Runtime.ListBuckets

Return the buckets visible to the handle.

Go1 line
func (r *Runtime) ListBuckets(ctx context.Context) ([]Bucket, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.

Returns: []Bucket, error.

Runtime.ListObjects

Return one page. Pass nextCursor to continue when truncated is true.

Go1 line
func (r *Runtime) ListObjects(ctx context.Context, bucket string, options ListOptions) (ObjectPage, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
options ListOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: ObjectPage, error.

Runtime.OpenObject

Go1 line
func (r *Runtime) OpenObject(ctx context.Context, bucket, key string) (io.ReadCloser, Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: io.ReadCloser, Object, error.

Runtime.OpenObjectRange

Go1 line
func (r *Runtime) OpenObjectRange(ctx context.Context, bucket, key string, span ObjectRange) (io.ReadCloser, Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
span ObjectRange Yes —

Returns: io.ReadCloser, Object, error.

Runtime.PutObject

Store complete bytes and metadata, subject to write conditions and quotas.

Go1 line
func (r *Runtime) PutObject(ctx context.Context, bucket, key string, data []byte, options PutOptions) (Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
data []byte Yes — Object bytes. Input ownership and size rules depend on the method.
options PutOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Object, error.

Runtime.PutObjectStream

Stage exactly options.size bytes and atomically publish after validation.

Go1 line
func (r *Runtime) PutObjectStream(ctx context.Context, bucket, key string, body io.Reader, options StreamPutOptions) (Object, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
body io.Reader Yes — Complete object payload for the selected native SDK helper.
options StreamPutOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Object, error.

Runtime.ReadForSave

Read bytes and metadata with an opaque condition, including observed absence. The condition grants no permission.

Go1 line
func (r *Runtime) ReadForSave(ctx context.Context, bucket, key string) (Object, SaveCondition, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: Object, SaveCondition, error.

Runtime.ReleaseObjectRecoveryHold

Go1 line
func (r *Runtime) ReleaseObjectRecoveryHold(ctx context.Context, id, owner string) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
owner string Yes — Identity that owns the durable recovery hold.

Returns: error.

Runtime.Reset

Clear storage state where the backend supports reset.

Go1 line
func (r *Runtime) Reset(ctx context.Context) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.

Returns: error.

Runtime.ResolveSave

Resolve the original request key without starting another save. Missing evidence leaves the effect unknown.

Go1 line
func (r *Runtime) ResolveSave(ctx context.Context, bucket, key, requestKey string) (SaveResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
requestKey string Yes — Unique persisted request identity for capture or save recovery.

Returns: SaveResult, error.

Runtime.SaveObject

Compare the observation at publication. Inspect Outcome even when an error is returned. Qualified filesystem stores retain keyed receipts.

Go1 line
func (r *Runtime) SaveObject(ctx context.Context, bucket, key string, data []byte, options SaveOptions) (SaveResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
data []byte Yes — Object bytes. Input ownership and size rules depend on the method.
options SaveOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: SaveResult, error.

Runtime.SupportsConditionalWrites

Go1 line
func (r *Runtime) SupportsConditionalWrites() bool

Returns: bool.

Runtime.SupportsDurableSaveRequests

Go1 line
func (r *Runtime) SupportsDurableSaveRequests() bool

Returns: bool.

Runtime.SupportsGuardedSaves

Go1 line
func (r *Runtime) SupportsGuardedSaves() bool

Returns: bool.

Runtime.SupportsRecoveryHolds

Go1 line
func (r *Runtime) SupportsRecoveryHolds() bool

Returns: bool.

Runtime.Usage

Return current storage accounting.

Go1 line
func (r *Runtime) Usage() Usage

Returns: Usage.

SaveCommitted

Go1 line
const SaveCommitted = stowruntime.SaveCommitted

SaveCondition

SaveCondition is opaque and valid only for its issuing runtime and resource.

Go3 lines
type SaveCondition struct {

}// contains filtered or unexported fields

SaveCondition.ObservedAbsence

Go1 line
func (c SaveCondition) ObservedAbsence() bool

Returns: bool.

SaveNotCommitted

Go1 line
const SaveNotCommitted = stowruntime.SaveNotCommitted

SaveOptions

Go5 lines
type SaveOptions struct {
	Condition	SaveCondition
	PutOptions	PutOptions
	RequestKey	string
}

SaveOutcome

Go1 line
type SaveOutcome string

SaveResult

Go5 lines
type SaveResult struct {
	Object		Object
	Outcome		SaveOutcome
	Replayed	bool
}

SaveUnknown

Go1 line
const SaveUnknown = stowruntime.SaveUnknown

SetRegistryPolicy

SetRegistryPolicy persists standing limits; zero is unlimited.

Go1 line
func SetRegistryPolicy(registryDir string, policy RegistryPolicy) error
Parameter Type Required Default Meaning
registryDir string Yes — Native registry directory for workspace metadata.
policy RegistryPolicy Yes —

Returns: error.

StagedObject

Go4 lines
type StagedObject interface {
	Commit(context.Context) (Object, error)
	Abort(context.Context) error
}

StagedWriteStore

Go3 lines
type StagedWriteStore interface {
	StageObject(context.Context, string, string, io.Reader, PutOptions) (StagedObject, error)
}

Store

Store supplies object storage to Open.

Go11 lines
type Store interface {
	CreateBucket(ctx context.Context, name string) error
	DeleteBucket(ctx context.Context, name string) error
	ListBuckets(ctx context.Context) ([]Bucket, error)
	PutObject(ctx context.Context, bucket, key string, data []byte, options PutOptions) (Object, error)
	GetObject(ctx context.Context, bucket, key string) (Object, error)
	HeadObject(ctx context.Context, bucket, key string) (Object, error)
	DeleteObject(ctx context.Context, bucket, key string) error
	ListObjects(ctx context.Context, bucket string, options ListOptions) (ObjectPage, error)
	Close() error
}

StreamingStore

Go3 lines
type StreamingStore interface {
	OpenObject(context.Context, string, string) (io.ReadCloser, Object, error)
}

StreamingWriteStore

Go3 lines
type StreamingWriteStore interface {
	PutObjectStream(context.Context, string, string, io.Reader, PutOptions) (Object, error)
}

StreamPutOptions

Go4 lines
type StreamPutOptions struct {
	Size	int64
	PutOptions
}

UpstreamRead

Go1 line
const UpstreamRead Operation = "upstream.read"

UpstreamWrite

Go1 line
const UpstreamWrite Operation = "upstream.write"

Usage

Return current storage accounting.

Go4 lines
type Usage struct {
	Bytes	int64
	Objects	int64
}

ValidateHandoff

Go1 line
func ValidateHandoff(document Handoff) error
Parameter Type Required Default Meaning
document Handoff Yes — Versioned handoff or delta document.

Returns: error.

VerifyDeltaDigest

VerifyDeltaDigest refuses a document that does not hash to what the sender said it hashes to.

Go1 line
func VerifyDeltaDigest(encoded []byte, expected string) error
Parameter Type Required Default Meaning
encoded []byte Yes —
expected string Yes —

Returns: error.

Workspace

Workspace is a real working directory and bucket over the same bytes (ADR 0007).

Go4 lines
type Workspace struct {
	*Runtime

}// contains filtered or unexported fields

Workspace.Bucket

Bucket is the bucket over the workspace's bytes.

Go1 line
func (w *Workspace) Bucket() string

Returns: string.

Workspace.Close

Release this handle. Do not submit new operations after closing it.

Go1 line
func (w *Workspace) Close() error

Returns: error.

Workspace.CreateCheckpoint

CreateCheckpoint captures immutable project files outside the mutable workspace.

Go1 line
func (w *Workspace) CreateCheckpoint(ctx context.Context, options CheckpointOptions) (CheckpointInfo, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
options CheckpointOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: CheckpointInfo, error.

Workspace.Destroy

Delete only an eligible owned workspace with EnvironmentDestroy authority. Adopted and protected directories are refused.

Go1 line
func (w *Workspace) Destroy(ctx context.Context) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.

Returns: error.

Workspace.Dir

Dir is the absolute workspace directory, stable for the workspace's life.

Go1 line
func (w *Workspace) Dir() string

Returns: string.

Workspace.Facade

Start or reuse a loopback S3 endpoint over this workspace's runtime.

Go1 line
func (w *Workspace) Facade() (*WorkspaceFacade, error)

Returns: *WorkspaceFacade, error.

Workspace.FacadeWithOptions

Start the workspace S3 facade with explicit request and concurrency limits.

Go1 line
func (w *Workspace) FacadeWithOptions(options WorkspaceFacadeOptions) (*WorkspaceFacade, error)
Parameter Type Required Default Meaning
options WorkspaceFacadeOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *WorkspaceFacade, error.

Workspace.ID

ID is the workspace's durable identity, which outlives this handle.

Go1 line
func (w *Workspace) ID() string

Returns: string.

Workspace.MaxCheckpointBytes

MaxCheckpointBytes is the cumulative payload-byte cap for retained checkpoints; zero means unlimited.

Go1 line
func (w *Workspace) MaxCheckpointBytes() int64

Returns: int64.

Workspace.MaxCheckpoints

MaxCheckpoints is the retained checkpoint count cap; zero means unlimited.

Go1 line
func (w *Workspace) MaxCheckpoints() int64

Returns: int64.

Workspace.OpenFileEditor

Go1 line
func (w *Workspace) OpenFileEditor(options WorkspaceEditOptions) (*WorkspaceEditor, error)
Parameter Type Required Default Meaning
options WorkspaceEditOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: *WorkspaceEditor, error.

Workspace.Path

Path returns where a key's bytes live, and whether they are there.

Go1 line
func (w *Workspace) Path(key string) (string, bool)
Parameter Type Required Default Meaning
key string Yes — Object or file key within the selected bucket or project.

Returns: string, bool.

Workspace.RefreshUsage

Reconcile direct filesystem writes at a quiescent boundary before quota-sensitive operations.

Go1 line
func (w *Workspace) RefreshUsage(ctx context.Context) error
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.

Returns: error.

Workspace.Touch

Touch records that the workspace was used, which is what a TTL is measured from.

Go1 line
func (w *Workspace) Touch() error

Returns: error.

Workspace.WorkingDirectory

WorkingDirectory is the directory an external task runner should use as its current working directory.

Go1 line
func (w *Workspace) WorkingDirectory() string

Returns: string.

WorkspaceDirectoryObservation

Go3 lines
type WorkspaceDirectoryObservation struct {

}// contains filtered or unexported fields

WorkspaceDirectoryObservation.Len

Go1 line
func (o *WorkspaceDirectoryObservation) Len() int

Returns: int.

WorkspaceDirectoryObservation.MetadataBytes

Go1 line
func (o *WorkspaceDirectoryObservation) MetadataBytes() int64

Returns: int64.

WorkspaceDirectoryObservation.ObservedAt

Go1 line
func (o *WorkspaceDirectoryObservation) ObservedAt() time.Time

Returns: time.Time.

WorkspaceDirectoryObservation.Page

Go1 line
func (o *WorkspaceDirectoryObservation) Page(ctx context.Context, offset, limit int) ([]WorkspaceReadEntry, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
offset int Yes —
limit int Yes — Maximum results per page; limits and defaults depend on the listing API.

Returns: []WorkspaceReadEntry, error.

WorkspaceDirectoryObservation.Path

Go1 line
func (o *WorkspaceDirectoryObservation) Path() string

Returns: string.

WorkspaceEditOptions

Go8 lines
type WorkspaceEditOptions struct {
	ReadRoots		[]string
	WriteRoots		[]string
	Coordination		string
	MaxFileBytes		int64
	MaxObservations		int
	ObservationLifetime	time.Duration
}

WorkspaceEditor

Go3 lines
type WorkspaceEditor struct {

}// contains filtered or unexported fields

WorkspaceEditor.Close

Release this handle. Do not submit new operations after closing it.

Go1 line
func (e *WorkspaceEditor) Close() error

Returns: error.

WorkspaceEditor.ReadForSave

Read bytes and metadata with an opaque condition, including observed absence. The condition grants no permission.

Go1 line
func (e *WorkspaceEditor) ReadForSave(ctx context.Context, path string) (WorkspaceFileRead, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.

Returns: WorkspaceFileRead, error.

WorkspaceEditor.ReleaseObservation

Go1 line
func (e *WorkspaceEditor) ReleaseObservation(token string) error
Parameter Type Required Default Meaning
token string Yes — Opaque identity returned by the corresponding observation or migration operation.

Returns: error.

WorkspaceEditor.ResolveSave

Resolve the original request key without starting another save. Missing evidence leaves the effect unknown.

Go1 line
func (e *WorkspaceEditor) ResolveSave(ctx context.Context, path, requestKey string) (WorkspaceFileSaveResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.
requestKey string Yes — Unique persisted request identity for capture or save recovery.

Returns: WorkspaceFileSaveResult, error.

WorkspaceEditor.SaveFile

SaveFile publishes bytes against a prior observation or an explicit replacement.

Go1 line
func (e *WorkspaceEditor) SaveFile(ctx context.Context, request WorkspaceFileSaveRequest) (WorkspaceFileSaveResult, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
request WorkspaceFileSaveRequest Yes —

Returns: WorkspaceFileSaveResult, error.

WorkspaceFacade

WorkspaceFacade describes the loopback S3 endpoint owned by a Workspace.

Go9 lines
type WorkspaceFacade struct {
	MaxMultipartUploads	int64	`json:"max_multipart_uploads"`
	MaxConcurrentRequests	int	`json:"max_concurrent_requests"`
	MaxRequestBytes		int64	`json:"max_request_bytes"`
	Endpoint		string	`json:"endpoint"`
	Region			string	`json:"region"`
	AccessKeyID		string	`json:"access_key_id"`
	SecretAccessKey		string	`json:"secret_access_key"`
}

WorkspaceFacadeOptions

Facade starts one authenticated loopback server sharing this workspace's runtime.

Go4 lines
type WorkspaceFacadeOptions struct {
	MaxRequestBytes		int64
	MaxConcurrentRequests	int
}

WorkspaceFileRead

Go11 lines
type WorkspaceFileRead struct {
	Path			string
	Data			[]byte
	Absent			bool
	SHA256			string
	Mode			os.FileMode
	Modified		time.Time
	Generation		string
	ObservationToken	string
	ExpiresAt		time.Time
}

WorkspaceFileSaveRequest

WorkspaceFileSaveRequest names one idempotent save in an attached workspace.

Go7 lines
type WorkspaceFileSaveRequest struct {
	Path			string
	Data			[]byte
	RequestKey		string
	ObservationToken	string
	Replace			bool
}

WorkspaceFileSaveResult

WorkspaceFileSaveResult reports the original receipt without returning file bytes.

Go6 lines
type WorkspaceFileSaveResult struct {
	Object		Object
	Generation	string
	Outcome		SaveOutcome
	Replayed	bool
}

WorkspaceInput

WorkspaceInput copies one local file or directory into a prepared workspace.

Go4 lines
type WorkspaceInput struct {
	Source		string	`json:"source"`
	Destination	string	`json:"destination"`
}

WorkspaceListing

WorkspaceListing is what a listing resolved to: the registry it actually read, and what that registry holds.

Go5 lines
type WorkspaceListing struct {
	Registry	string
	Team		string
	Workspaces	[]WorkspaceSummary
}

WorkspaceOptions

WorkspaceOptions configures a workspace with a required directory.

Go17 lines
type WorkspaceOptions struct {
	Dir			string
	Bucket			string
	MaxBytes		int64
	MaxObjects		int64
	MaxMultipartUploads	int64
	MaxCheckpointBytes	int64
	MaxCheckpoints		int64
	Authority		*Authority
	Policy			policy.Source
	TTL			time.Duration
	RegistryDir		string
	Team			string
	Adopted			bool
	Now			func() time.Time

}// contains filtered or unexported fields

WorkspaceReadEntry

WorkspaceReadEntry describes one direct child of a directory.

Go6 lines
type WorkspaceReadEntry struct {
	Name	string	`json:"name"`
	Path	string	`json:"path"`
	Kind	string	`json:"kind"`
	Size	int64	`json:"size"`
}

WorkspaceReader

WorkspaceReader is a confined, read-only attachment to one registered workspace.

Go3 lines
type WorkspaceReader struct {

}// contains filtered or unexported fields

WorkspaceReader.Close

Release this handle. Do not submit new operations after closing it.

Go1 line
func (r *WorkspaceReader) Close() error

Returns: error.

WorkspaceReader.ObserveDirectory

Go1 line
func (r *WorkspaceReader) ObserveDirectory(ctx context.Context, path string) (*WorkspaceDirectoryObservation, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.

Returns: *WorkspaceDirectoryObservation, error.

WorkspaceReader.ReadDirectory

ReadDirectory returns a complete, sorted observation of one directory's direct visible children.

Go1 line
func (r *WorkspaceReader) ReadDirectory(ctx context.Context, path string) ([]WorkspaceReadEntry, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.

Returns: []WorkspaceReadEntry, error.

WorkspaceReader.ReadFile

ReadFile returns the current bytes of a regular workspace file, within the configured decoded-byte bound.

Go1 line
func (r *WorkspaceReader) ReadFile(ctx context.Context, path string) (WorkspaceReadFile, error)
Parameter Type Required Default Meaning
ctx context.Context Yes — Context for cancellation and deadlines.
path string Yes — Local path selected for this file or archive operation.

Returns: WorkspaceReadFile, error.

WorkspaceReader.Reference

Reference returns the resolved host-side identity and paths.

Go1 line
func (r *WorkspaceReader) Reference() WorkspaceReference

Returns: WorkspaceReference.

WorkspaceReaderOptions

WorkspaceReaderOptions selects one registered workspace and narrows its read bounds.

Go7 lines
type WorkspaceReaderOptions struct {
	RegistryDir	string
	WorkspaceID	string
	MaxFileBytes	int64
	MaxEntries	int
	ReadRoots	[]string
}

WorkspaceReadFile

WorkspaceReadFile contains bounded current bytes from the live working view.

Go6 lines
type WorkspaceReadFile struct {
	Path		string
	Data		[]byte
	ContentType	string
	Modified	time.Time
}

WorkspaceReference

WorkspaceReference is what the registry records about a workspace, read without opening it.

Go8 lines
type WorkspaceReference struct {
	WorkingDirectory	string
	ID			string
	Dir			string
	Bucket			string
	MaxCheckpointBytes	int64
	MaxCheckpoints		int64
}

WorkspaceSummary

WorkspaceSummary is one workspace as a caller can see it without resuming it.

Go14 lines
type WorkspaceSummary struct {
	ID			string	`json:"id"`
	Dir			string	`json:"dir"`
	Bucket			string	`json:"bucket"`
	Created			string	`json:"created"`
	LastUsed		string	`json:"last_used"`
	AgeSeconds		int64	`json:"age_seconds"`
	IdleSeconds		int64	`json:"idle_seconds"`
	TTLSeconds		int64	`json:"ttl_seconds"`
	ExpiresInSeconds	int64	`json:"expires_in_seconds"`
	HasTTL			bool	`json:"has_ttl"`
	Owned			bool	`json:"owned"`
	Readable		bool	`json:"readable"`
}

WorkspaceTaskManifest

WorkspaceTaskManifest is the versioned JSON input accepted by workspace preparation tools.

Go18 lines
type WorkspaceTaskManifest struct {
	Version			int			`json:"version"`
	Root			string			`json:"root"`
	WorkingDirectory	string			`json:"working_directory,omitempty"`
	Inputs			[]WorkspaceInput	`json:"inputs,omitempty"`
	Repositories		[]GitRepositoryInput	`json:"repositories,omitempty"`
	MaxBytes		int64			`json:"max_bytes,omitempty"`
	MaxObjects		int64			`json:"max_objects,omitempty"`
	MaxCheckpointBytes	int64			`json:"max_checkpoint_bytes,omitempty"`
	MaxCheckpoints		int64			`json:"max_checkpoints,omitempty"`
	MaxWorkspaces		int64			`json:"max_workspaces,omitempty"`
	TTLSeconds		int64			`json:"ttl_seconds,omitempty"`
	Team			string			`json:"team,omitempty"`
	RegistryDir		string			`json:"registry_dir,omitempty"`
	Bucket			string			`json:"bucket,omitempty"`
	IncludeSensitiveInputs	bool			`json:"include_sensitive_inputs,omitempty"`
	SensitivePaths		string			`json:"sensitive_paths,omitempty"`
}