Documentation
¶
Overview ¶
Package managedtemp owns the private Unix filesystem namespace used by managed command temporary storage. It intentionally exposes no deletion primitives.
Index ¶
- Variables
- func ValidTestHomeMarker(marker string) bool
- type Lease
- type Namespace
- func (n *Namespace) Close() error
- func (n *Namespace) OpenWorkspace(backend, identity, canonicalPath string) (*Workspace, error)
- func (n *Namespace) Path() string
- func (n *Namespace) ReadSweepCompletion() (time.Time, error)
- func (n *Namespace) Sweep(ctx context.Context, opts SweepOptions) (SweepResult, error)
- func (n *Namespace) WritePrivateFile(name string, data []byte) error
- type SweepOptions
- type SweepResult
- type Workspace
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedVersion = errors.New("managedtemp: unsupported manifest version")
ErrUnsupportedVersion reports a record whose format cannot be safely read.
Functions ¶
func ValidTestHomeMarker ¶
ValidTestHomeMarker reports whether marker names a private command lease created by this protocol. It rejects ordinary paths and malformed metadata; test-home uses it before placing process-wide HOME state under the lease.
Types ¶
type Lease ¶
type Lease struct {
// contains filtered or unexported fields
}
Lease is one locked command or job allocation. Its path is adapter-internal.
func (*Lease) Remove ¶
Remove validates that the parent still names the retained lease handle, then traverses that handle without following links.
func (*Lease) Started ¶
Started records the process identity after the runner successfully starts its dedicated process group.
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace is a private managed root. Every mutation is relative to root.
func Open ¶
Open creates or adopts an absolute managed root. Existing objects are never chmodded: ownership, type, link, and mode must already be private.
func (*Namespace) OpenWorkspace ¶
OpenWorkspace creates or adopts the private namespace for one transient workspace identity. The digest key, never the raw identity, is used in the path. canonicalPath is retained only in the owner-readable manifest for operator diagnosis.
func (*Namespace) ReadSweepCompletion ¶
ReadSweepCompletion reads the durable sweep record without changing it.
func (*Namespace) Sweep ¶
func (n *Namespace) Sweep(ctx context.Context, opts SweepOptions) (SweepResult, error)
Sweep performs one non-blocking, root-coordinated recovery pass. It never waits for an active command's lease lock and only removes validated leases.
type SweepOptions ¶
SweepOptions controls one bounded, interval-gated recovery pass. Now is supplied by composition so tests and scheduled maintenance are deterministic.
type SweepResult ¶
SweepResult reports whether this caller scanned rather than observing a recent completion or another process's root sweep lock.
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
Workspace is one private workspace namespace below a Namespace.
func (*Workspace) Allocate ¶
Allocate creates and locks a private cmd or job lease before publishing its manifest.
func (*Workspace) CreatePrivateFile ¶
CreatePrivateFile creates an empty private file below the workspace.