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
- Variables
- type Authority
- func (authority *Authority) CanonicalLocatorKey(path string) (string, error)
- func (authority *Authority) Close() error
- func (authority *Authority) FinalizeDirectory(ctx context.Context, claim outputsession.DirectoryClaim) (outputsession.DirectoryFinalization, error)
- func (authority *Authority) MaterializeDirectory(ctx context.Context, claim outputsession.DirectoryClaim) (outputsession.DirectoryMaterialization, error)
- type ClaimID
- type Config
- type DirectoryDisposition
- type FileAuthority
- type OwnedObjectAuthority
- type ParentNamespaceSnapshotter
- type Platform
- type PublicEntryName
- type TraceEvent
- type TraceOperation
- type TraceOutcome
Constants ¶
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 )
const ( DirectoryCallerProvidedRoot = outputsession.DirectoryCallerProvidedRoot DirectoryAuthorityCreatedRoot = outputsession.DirectoryAuthorityCreatedRoot DirectoryAuthorityCreatedDescendant = outputsession.DirectoryAuthorityCreatedDescendant DirectoryPreexistingDescendant = outputsession.DirectoryPreexistingDescendant )
Variables ¶
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") 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 (*Authority) CanonicalLocatorKey ¶
CanonicalLocatorKey exposes only the comparable key reserved by outputsession; richer path-local details never leave this native-authority module.
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 ¶
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 )