Documentation
¶
Overview ¶
Package registry is a generic, YAML-persisted store of named entries shared by the plugin and skill-pack installers. Both persist the same record shape (Entry) under a single top-level key (e.g. "plugins" or "packs"); the only difference is the file name and that key, so the storage logic lives here once and is parameterized per caller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Name string `yaml:"name"`
SourceURL string `yaml:"source_url"`
Ref string `yaml:"ref"`
Enabled bool `yaml:"enabled"`
}
Entry is one installed item's registry record. Plugins and skill packs share this shape.
type Registry ¶
type Registry[E any] struct { Entries []E // contains filtered or unexported fields }
Registry is a list of entries persisted to <baseDir>/<file> under a single top-level YAML key. It is generic over the entry type; nameOf extracts the unique name used by Find/Upsert/Remove.
func Load ¶
Load reads <baseDir>/<file>, returning an empty registry if the file does not exist yet. The file is a single top-level mapping of key → entry list, so an unrelated key or a missing file both yield no entries.
func (*Registry[E]) Find ¶
Find returns a pointer to the entry with the given name, or nil. Mutating the returned entry mutates the registry in place.