sources

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

type SourceConfig struct {
	Sources     *Sources
	ActiveRoots []string
	IncludeList []string
}

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.

type Sources

type Sources struct {
	Conformance string
	Discovery   string
	Googleapis  string
	ProtobufSrc string
	Showcase    string
}

Sources contains resolved directory paths for source repositories.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL