outputprobe

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

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

Documentation

Overview

Package outputprobe owns native feature proofs and exact-object cleanup. Platforms supply live outputcap handles and their data-link probe shape; native locking and restart enrollment remain platform-owned.

Index

Constants

View Source
const (
	NamePrefix          = ".windshare-output.probe-"
	ReservedPrefix      = ".windshare-output.probe"
	RandomBytes         = 16
	AllocationAttempts  = 16
	MaximumLeftovers    = 64
	StageName           = "stage"
	PublicStageName     = "live-stage"
	AnchorName          = "anchor"
	PublicationName     = "publication"
	RecordName          = "record"
	TemporaryRecordName = "record.tmp"
	CandidateName       = "candidate"
	InstalledName       = "installed"
)

Variables

This section is empty.

Functions

func CanonicalName

func CanonicalName(name string) bool

func NewName

func NewName(random io.Reader) (string, error)

func Recover

func Recover(root outputcap.Directory, names []string, profile Profile) (resultErr error)

Recover validates every bounded leftover before the first deletion. One foreign or malformed namespace cannot cause earlier valid entries to vanish.

func Validate

func Validate(profile Profile, observation Observation) error

Validate rejects observations that cannot occur at a deterministic process-restart cut for profile.

Types

type Observation

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

Observation accumulates the fixed probe vocabulary without granting path authority. Native recovery retains the opened handles separately and submits only immutable presence and size facts here.

func (*Observation) ObserveDirectory

func (observation *Observation) ObserveDirectory(name string) error

ObserveDirectory records one recognized probe directory.

func (*Observation) ObserveFile

func (observation *Observation) ObserveFile(name string, size uint64) error

ObserveFile records one recognized probe file.

type Profile

type Profile uint8

Profile selects the native data-link shape used by an output probe.

const (
	// EmptyDataLinks validates the zero-length links and optional public-stage evidence.
	EmptyDataLinks Profile = iota + 1
	// SizedDataLinks validates the one-byte hard links without public-stage evidence.
	SizedDataLinks
)

type Results

type Results struct {
	SafePublish       error
	OperationRecovery error
	RangeRecovery     error
	CrashCleanup      error
}

Results keeps independent capability failures separate from namespace contradictions, which must reject the whole destination.

func (Results) Capabilities

func (results Results) Capabilities() (outputcap.DestinationCapabilities, error)

func (Results) Err

func (results Results) Err() error

type Workspace

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

Workspace owns the probe's children and directory, borrowing only its root. Possible target names are recorded before mutation: an error after a native rename/link must not erase the witness needed for exact-object cleanup.

func Allocate

func Allocate(root outputcap.Directory, random io.Reader) (*Workspace, error)

Allocate owns only an exclusively created namespace. A collision never grants permission to inspect or remove the existing entry.

func Inspect

func Inspect(root outputcap.Directory, name string, profile Profile) (_ *Workspace, resultErr error)

func NewWorkspace

func NewWorkspace(root outputcap.Directory, name string, directory outputcap.Directory) *Workspace

func (*Workspace) Cleanup

func (workspace *Workspace) Cleanup() (resultErr error)

Cleanup attempts deletion once and closes the workspace even on failure. Closed handles do not prove deletion: subsequent calls return fs.ErrClosed. Recover must inspect leftovers again before a new cleanup attempt.

func (*Workspace) Clear

func (workspace *Workspace) Clear() error

Clear ends one independent capability proof before another reuses its names. Stopping on I/O failure preserves the recovery cut. On identity mismatch it preserves evidence of foreign replacement: removing the other links could make the replacement look like an owned creation prefix on the next restart.

func (*Workspace) Close

func (workspace *Workspace) Close() error

Close releases inspection/creation handles without authorizing any deletion. It is safe to repeat; all operations requiring live witnesses then return fs.ErrClosed.

func (*Workspace) Directory

func (workspace *Workspace) Directory() outputcap.Directory

Directory borrows the live directory; it is nil after Close or Cleanup.

func (*Workspace) FilePublication

func (workspace *Workspace) FilePublication() error

FilePublication exercises the publication primitive used by the receiver. Hard links and restart identity are independent and cannot gate this proof.

func (*Workspace) KeepFile

func (workspace *Workspace) KeepFile(name string, file outputcap.FileIdentity) error

KeepFile consumes the original creation witness even when installation returned an error. A closed workspace releases it instead of retaining it: reopening a name alone cannot restore cleanup ownership.

func (*Workspace) OperationRecovery

func (workspace *Workspace) OperationRecovery() error

func (*Workspace) RangeRecovery

func (workspace *Workspace) RangeRecovery() error

func (*Workspace) SafePublish

func (workspace *Workspace) SafePublish(profile Profile) error

func (*Workspace) VerifyFile

func (workspace *Workspace) VerifyFile(name string, private bool) error

func (*Workspace) VerifyFiles

func (workspace *Workspace) VerifyFiles() error

VerifyFiles proves that reopening cleanup names preserves the retained object identities. It does not infer restart guarantees from successful live I/O.

Jump to

Keyboard shortcuts

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