Documentation
¶
Overview ¶
Package curate turns a parsed manifest and a toolset from plugit.yaml into the active toolset: which tools are served, under which names and descriptions, with which per-tool policy. It is pure: no I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNameConflict = errors.New("tool name conflict")
ErrNameConflict means the final tool names clash or don't fit.
Functions ¶
func AddToToolset ¶
AddToToolset lists keys in a toolset (creating it if needed). Keys already listed keep their overrides untouched: sync only ever adds.
func CheckNames ¶
CheckNames reports the first name that is too long with the prefix or clashes with another (ignoring case).
Types ¶
type OpChange ¶
type OpChange struct {
Key model.OpKey
Old *model.Tool
New *model.Tool
What []string
Listed []string
AutoSelected []string
}
OpChange is one operation that differs between two manifests.
type Result ¶
Result is the active toolset.
func Apply ¶
Apply selects tools from all (a manifest's tools, already named with prefix) according to ts (SPEC §9 item 6):
- a tool is selected when its key is listed in ts.Tools;
- include_tags and methods narrow the selection, or, when no keys are listed, select from the whole manifest;
- a toolset with neither selects nothing.
A name override gets the prefix too (§9 item 7). Override descriptions are cleaned like spec text. Final names must be unique case-insensitively.
type SyncDiff ¶
type SyncDiff struct {
Added, Removed, Changed []OpChange
ServersBefore, ServersAfter []string
ServersChanged bool
BaseURLListed bool
}
SyncDiff is what `plugit sync` shows before adopting a new spec (SPEC §2.3 "Sync diff", T3).
func DiffManifests ¶
DiffManifests compares the manifest plugit has with a newly parsed one. Tools are matched by OpKey, their stable identity.