directoryauthority

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: 14 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 directoryauthority materializes and settles one output directory edge at a time while retaining the native authority needed to revalidate later work.

Index

Constants

View Source
const (
	// DefaultParentSnapshotEntryLimit matches the catalog's direct-child bound.
	// A destination with more entries cannot be indexed without accepting more
	// namespace work than one frozen directory generation can justify.
	DefaultParentSnapshotEntryLimit = catalog.MaxDirectoryEntries
	// MaximumPlatformAliasesPerEntry reflects the one alternate DOS 8.3 name
	// exposed by the Windows native directory record.
	MaximumPlatformAliasesPerEntry = 1
)
View Source
const (
	DirectoryCallerProvidedRoot         = outputsession.DirectoryCallerProvidedRoot
	DirectoryAuthorityCreatedRoot       = outputsession.DirectoryAuthorityCreatedRoot
	DirectoryAuthorityCreatedDescendant = outputsession.DirectoryAuthorityCreatedDescendant
	DirectoryPreexistingDescendant      = outputsession.DirectoryPreexistingDescendant
)

Variables

View Source
var (
	ErrInvalidConfiguration      = errors.New("directory authority configuration is invalid")
	ErrAuthorityClosed           = errors.New("directory authority is closed")
	ErrInvalidLocator            = errors.New("directory authority locator is invalid")
	ErrInvalidClaim              = errors.New("directory authority claim is invalid")
	ErrClaimConflict             = errors.New("directory authority claim conflicts with retained authority")
	ErrParentUnavailable         = errors.New("directory authority parent is unavailable")
	ErrParentSnapshotUnavailable = errors.New("directory authority parent snapshot is unavailable")
	ErrPlatformEquivalentLocator = errors.New("directory authority locator has a platform-equivalent collision")
	ErrEntryCollision            = errors.New("directory authority target entry collides with existing output")
	ErrRetainedAuthorityChanged  = errors.New("directory authority retained path changed")
	ErrMetadataReconcile         = errors.New("directory metadata outcome cannot be reconciled")

	// ErrNoMutation marks an error observed before this claim changed the public
	// namespace. The session ledger may roll back its pending reservation.
	ErrNoMutation = errors.New("directory authority made no namespace mutation")
	// ErrMutationAmbiguous marks an operation whose public or durable outcome
	// cannot be proved. The session must retain the claim and pause.
	ErrMutationAmbiguous = errors.New("directory authority mutation is ambiguous")
)

Functions

This section is empty.

Types

type Authority

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

Authority retains claim receipts for replay and conflict detection. Native capabilities and namespace indexes belong only to unsettled executions; outputsession seals descendants before invoking directory finalization.

func New

func New(platform Platform, config Config) (*Authority, error)

func (*Authority) CanonicalLocatorKey

func (authority *Authority) CanonicalLocatorKey(path string) (string, error)

CanonicalLocatorKey exposes only the comparable key reserved by outputsession; richer path-local details never leave this native-authority module.

func (*Authority) Close

func (authority *Authority) Close() error

func (*Authority) FinalizeDirectory

func (authority *Authority) FinalizeDirectory(
	ctx context.Context,
	claim outputsession.DirectoryClaim,
) (outputsession.DirectoryFinalization, error)

func (*Authority) MaterializeDirectory

func (authority *Authority) MaterializeDirectory(
	ctx context.Context,
	claim outputsession.DirectoryClaim,
) (outputsession.DirectoryMaterialization, error)

type ClaimID

type ClaimID = outputsession.ClaimID

ClaimID is only a session-local lookup key for retained native state. Catalog NodeID ownership remains exclusively in outputsession's global claim ledger.

type Config

type Config struct {
	ParentSnapshotEntryLimit int
	Snapshotter              ParentNamespaceSnapshotter
	Trace                    func(TraceEvent)
}

Config supplies bounded namespace inspection and an optional post-lock trace.

type DirectoryDisposition

type DirectoryDisposition = outputsession.DirectoryDisposition

type FileAuthority

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

func NewFileAuthority

func NewFileAuthority(
	directories *Authority,
	objects OwnedObjectAuthority,
	sessionID transfer.OutputSessionID,
) (*FileAuthority, error)

func NewLiveFileAuthority

func NewLiveFileAuthority(
	directories *Authority,
	sessionID transfer.OutputSessionID,
) (*FileAuthority, error)

NewLiveFileAuthority binds destinations for a live-only transaction. Public publication compares and links the retained stage handle directly, so there is no checkpoint object store or second ownership witness.

func (*FileAuthority) BindFile

func (authority *FileAuthority) BindFile(
	ctx context.Context,
	file transfer.MaterializationFile,
	destinationPath transfer.OutputDestinationPath,
) (destination fileexecution.FileDestination, resultErr error)

type OwnedObjectAuthority

type OwnedObjectAuthority interface {
	FinalMatchesPublication(context.Context, checkpointmodel.ObjectID, uint64, outputcap.FileIdentity) (bool, error)
	PublishOwnedNoReplace(
		context.Context,
		checkpointmodel.ObjectID,
		uint64,
		outputcap.Directory,
		string,
	) (outputcap.ObservedFile, error)
}

OwnedObjectAuthority keeps private stage and anchor handles behind their checkpoint namespace. Directory authority receives only exact comparison and no-replace publication operations for an already-bound object ID.

type ParentNamespaceSnapshotter

type ParentNamespaceSnapshotter interface {
	SnapshotPublicEntryNames(outputcap.Directory, int) ([]PublicEntryName, error)
}

ParentNamespaceSnapshotter is injected because outputcap currently exposes long-name enumeration but not Windows long/short-name pairs. The default uses Directory.Names; a platform adapter can provide the richer snapshot without widening the shared capability surface during this implementation wave.

type Platform

type Platform interface {
	AcquirePublicOperationGuard() (outputcap.PublicOperationGuard, error)
	RootOpenDisposition() outputcap.RootOpenDisposition
	ValidateModifiedTime(catalog.ModifiedTime) error
	CanonicalLocatorKey(string) (string, error)
	CanonicalComponentKey(string) (string, error)
}

Platform is the narrow existing outputcap surface used by this consumer.

type PublicEntryName

type PublicEntryName struct {
	Name    string
	Aliases []string
}

PublicEntryName records every spelling by which one immutable parent snapshot can resolve an entry. Aliases are bounded by the native Windows record shape.

type TraceEvent

type TraceEvent struct {
	Operation   TraceOperation
	Outcome     TraceOutcome
	ClaimID     ClaimID
	ParentID    ClaimID
	Disposition DirectoryDisposition
	Cached      bool
}

TraceEvent intentionally omits canonical paths and locator keys.

type TraceOperation

type TraceOperation uint8

TraceOperation and TraceOutcome are stable structured observability values.

const (
	TraceMaterializeDirectory TraceOperation = iota + 1
	TraceFinalizeDirectory
)

type TraceOutcome

type TraceOutcome uint8
const (
	TraceSucceeded TraceOutcome = iota + 1
	TraceIsolatedFailure
	TraceNoMutation
	TraceMutationAmbiguous
)

Jump to

Keyboard shortcuts

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