Documentation
¶
Overview ¶
Package freshness owns one repository's index, native watcher, startup reconciliation, generation barrier, health, and joined shutdown. Foreground and daemon lifecycles share this owner so process management never forks the graph mutation path.
Index ¶
- func MapSyncResult(result indexer.SyncResult) (watch.SyncResult, error)
- func ReconcilePaths(idx *indexer.Indexer, paths []string) (watch.SyncResult, error)
- func ReconcileStartup(idx *indexer.Indexer) (watch.SyncResult, error)
- func Start(ctx context.Context, root string, opts Options) (*Owner, StartupResult, error)
- type Options
- type Owner
- type ReconcilePathsFunc
- type ReconcileStartupFunc
- type StartupResult
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapSyncResult ¶
func MapSyncResult(result indexer.SyncResult) (watch.SyncResult, error)
MapSyncResult maps indexer outcomes into watcher lifecycle semantics.
func ReconcilePaths ¶
ReconcilePaths uses the canonical indexer path-aware/full-rebuild boundary.
func ReconcileStartup ¶
func ReconcileStartup(idx *indexer.Indexer) (watch.SyncResult, error)
ReconcileStartup performs authoritative incremental startup reconciliation.
Types ¶
type Options ¶
type Options struct {
Watch watch.Options
ReconcilePaths ReconcilePathsFunc
ReconcileStartup ReconcileStartupFunc
OnStartupStarted func(time.Time)
OnStartupDone func(time.Time, time.Duration, watch.SyncResult, error)
}
Options configures a repository freshness owner.
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner holds one open index and its watcher.
func (*Owner) Indexer ¶ added in v0.8.0
Indexer returns the shared open index owned by this freshness session. Callers may issue concurrent read queries but must not close it.
type ReconcilePathsFunc ¶
ReconcilePathsFunc reconciles exact dirty paths; nil requests a full rebuild.
type ReconcileStartupFunc ¶
type ReconcileStartupFunc func(*indexer.Indexer) (watch.SyncResult, error)
ReconcileStartupFunc reconciles authoritative repository state at startup.
type StartupResult ¶
type StartupResult struct {
Result watch.SyncResult
Duration time.Duration
}
StartupResult describes the reconciliation completed before readiness.
type Status ¶
type Status struct {
ProjectPath string
WatchReady bool
IndexCurrent bool
PendingDirtyPaths int
WholeTreeDirty bool
AcceptedGeneration uint64
CompletedGeneration uint64
LastSuccessfulUpdate time.Time
LastReconciliation time.Time
LastOperationDuration time.Duration
LastError string
}
Status is a point-in-time freshness health snapshot.