Documentation
¶
Index ¶
- type Obj
- func (obj *Obj) Close(ctx context.Context) error
- func (obj *Obj) ComposerKeyForName(name string) (string, bool)
- func (obj *Obj) ComposerPackageNames() []string
- func (obj *Obj) RegisterMetrics(meterObj metric.Meter) error
- func (obj *Obj) RunOnce(ctx context.Context)
- func (obj *Obj) SetSuppressed(keySet map[string]struct{})
- func (obj *Obj) Start()
- func (obj *Obj) Trigger()
- type SourceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Obj ¶
type Obj struct {
// contains filtered or unexported fields
}
Obj supervises rescans. Dependencies are immutable after New; mutable cycle state has dedicated locks.
func New ¶
func New( configObj *stconf.ConfigObj, sourceObj SourceInterface, storageObj *storage.Obj, overlayObj *overlay.Obj, stateObj *state.Obj, archiveObj *archive.Obj, yggHost string, logArr ...zerolog.Logger, ) *Obj
New builds a rescan supervisor. yggHost is the Yggdrasil listener entry host; empty means Yggdrasil is disabled. The background loop is not started here; callers use Start and optionally RunOnce.
func (*Obj) Close ¶
Close cancels the loop and waits for exit. storage.Publish* calls are atomic, so there is no partial state to clean up.
func (*Obj) ComposerKeyForName ¶
ComposerKeyForName returns the storage key that owns a composer name. Only collision winners are exposed; unknown or collided names return false.
func (*Obj) ComposerPackageNames ¶
ComposerPackageNames returns sorted composer names without collisions. mod/server serves them live through overlay.ComposerPackages and overlay.ComposerPackageList.
func (*Obj) RegisterMetrics ¶
RegisterMetrics registers instruments for the rescan group. A nil meter is a no-op; rescan depends only on neutral otel/metric types.
func (*Obj) RunOnce ¶
RunOnce runs one cycle synchronously for initial fill and tests. Do not call it in parallel with an active Start loop.
func (*Obj) SetSuppressed ¶
SetSuppressed sets keys excluded by boot name-to-URL checks. Rescan skips them without touching local data, preserving degraded-first serving.
type SourceInterface ¶
type SourceInterface interface {
Discover(ctx context.Context, key string, rootURL string) (source.DiscoveryResultObj, error)
Releases(ctx context.Context, sourceURL string, depth uint) ([]source.GitReleaseObj, bool, error)
Tags(ctx context.Context, sourceURL string, depth uint) ([]source.GitReleaseObj, bool, error)
Refs(ctx context.Context, sourceURL string) (map[string]string, error)
FetchArchive(ctx context.Context, reqObj source.GitFetchRequestObj) (source.GitFetchResultObj, error)
PublicMirrorVersions(ctx context.Context, rootURL string, remoteKey string) ([]source.PublicMirrorVersionObj, bool, error)
BrotherDial(ctx context.Context, localKey string, remoteKey string, brotherURL string) (source.BrotherSessionInterface, error)
}
SourceInterface is the outbound layer orchestrated by rescan and faked in tests. BrotherDial returns source.BrotherSessionInterface, so *source.Obj satisfies it directly.