Documentation
¶
Overview ¶
Package collections manages YAML-based collection configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
PathContext map[string]string `yaml:"path_context"`
}
Collection describes a named document namespace.
func (*Collection) ResolveContext ¶
func (c *Collection) ResolveContext(path string) string
ResolveContext returns the concatenated context for a given path. Algorithm: for every prefix key in PathContext, if path has that prefix, collect it. Sort matched prefixes shortest-to-longest. Concatenate their values with "\n\n". Returns empty string if no matches.
type Config ¶
type Config struct {
Collections []Collection `yaml:"collections"`
}
Config is the top-level YAML structure.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds loaded collections, keyed by name.
func Load ¶
Load reads the YAML file at path and returns a Registry. If the file does not exist, Load returns an empty Registry (not an error).
func (*Registry) All ¶
func (r *Registry) All() []*Collection
All returns all collections in definition order.