Documentation
¶
Overview ¶
Package syncer runs a sync cycle: fetch the registry, resolve the developer's skills and apply them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Skipped bool // another sync is running, or the last one is too recent
Commit string
Report install.Report
Warnings []string
}
Result describes a sync run.
type Syncer ¶
type Syncer struct {
Paths paths.Paths
Installer *install.Installer
Now func() time.Time
// FetchTimeout bounds the registry fetch; when it expires the sync goes
// on offline with the last fetched registry. Zero means no limit.
FetchTimeout time.Duration
// FetchBackoff skips the network for this long after a failed fetch, so
// agent hooks do not wait on a dead network at every session start.
FetchBackoff time.Duration
// TrustLocalTags only fetches the pinned tags missing locally, without
// checking whether known tags moved upstream: tags are immutable here,
// so agent hooks skip that network round trip. Manual and timer syncs
// leave it off and report moved tags.
TrustLocalTags bool
// NoFetch uses the registry as last fetched, e.g. right after init
// fetched it.
NoFetch bool
}
Syncer keeps the installed skills in line with the registry.
func (*Syncer) Lock ¶
Lock waits for the sync lock, for commands that change the configuration and then sync: the change and the sync it triggers are never interleaved with a hook sync.