Documentation
¶
Overview ¶
Package paths provides a shared prefix resolver for named directory paths. Components that need to resolve prefixed paths (kb:, scratchpad:, etc.) use a single Resolver instance built from configuration at startup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandHome ¶
ExpandHome replaces a leading ~ with the user's home directory.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver maps named prefixes to absolute directory paths. It is nil-safe: calling Resolver.Resolve on a nil *Resolver returns the input path unchanged, matching the nil-safe pattern used by the event bus.
func New ¶
New creates a Resolver from a prefix-to-directory map. Keys are prefix names without the trailing colon (e.g., "kb", not "kb:"). Home directory tildes (~) in values are expanded at construction time. Returns nil if the map is empty or nil.
func (*Resolver) Prefixes ¶
Prefixes returns the registered prefix names sorted alphabetically, without trailing colons. Useful for documentation and help output.