Documentation
¶
Overview ¶
Package sources provides types for resolved source repository paths and path resolution utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SourceConfig ¶
SourceConfig holds the configuration for source roots and path resolution.
func NewSourceConfig ¶
func NewSourceConfig(sources *Sources, activeRoots []string) *SourceConfig
NewSourceConfig creates a SourceConfig with the given sources and active roots. If activeRoots is empty, it defaults to ["googleapis"].
func (*SourceConfig) Resolve ¶
func (c *SourceConfig) Resolve(relPath string) string
Resolve returns an absolute path for the given relative path if it is found within the active source roots. Otherwise, it returns the original path.
func (*SourceConfig) ResolveDir ¶
func (c *SourceConfig) ResolveDir(relPath string) string
ResolveDir returns the absolute path for the given relative path within the active source roots, ensuring the result is a directory.
func (*SourceConfig) Root ¶
func (c *SourceConfig) Root(name string) string
Root returns the directory path for the given root name.