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
- func CanonicalName(name string) bool
- func NewName(random io.Reader) (string, error)
- func Recover(root outputcap.Directory, names []string, profile Profile) (resultErr error)
- func Validate(profile Profile, observation Observation) error
- type Observation
- type Profile
- type Results
- type Workspace
- func (workspace *Workspace) Cleanup() (resultErr error)
- func (workspace *Workspace) Clear() error
- func (workspace *Workspace) Close() error
- func (workspace *Workspace) Directory() outputcap.Directory
- func (workspace *Workspace) FilePublication() error
- func (workspace *Workspace) KeepFile(name string, file outputcap.FileIdentity) error
- func (workspace *Workspace) OperationRecovery() error
- func (workspace *Workspace) RangeRecovery() error
- func (workspace *Workspace) SafePublish(profile Profile) error
- func (workspace *Workspace) VerifyFile(name string, private bool) error
- func (workspace *Workspace) VerifyFiles() error
Constants ¶
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 Recover ¶
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.
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)
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 ¶
Allocate owns only an exclusively created namespace. A collision never grants permission to inspect or remove the existing entry.
func NewWorkspace ¶
func (*Workspace) Cleanup ¶
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 ¶
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 ¶
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 ¶
Directory borrows the live directory; it is nil after Close or Cleanup.
func (*Workspace) FilePublication ¶
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) RangeRecovery ¶
func (*Workspace) SafePublish ¶
func (*Workspace) VerifyFile ¶
func (*Workspace) VerifyFiles ¶
VerifyFiles proves that reopening cleanup names preserves the retained object identities. It does not infer restart guarantees from successful live I/O.