Documentation
¶
Overview ¶
Package depresolver provides multi-source dependency resolution for protobuf files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Name string `yaml:"name"`
Source Source `yaml:"source,omitempty"` // default: auto-detect -> gomod
URL string `yaml:"url"`
Path string `yaml:"path,omitempty"` // subdirectory within the source
Version *string `yaml:"version,omitempty"` // version for gomod
Ref string `yaml:"ref,omitempty"` // for git: tag/branch/commit
Optional *bool `yaml:"optional,omitempty"` // skip if not found
}
Dependency represents a proto dependency configuration
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages dependency resolution
func NewManager ¶
NewManager creates a new dependency manager
func (*Manager) CleanCache ¶
CleanCache removes all cached dependencies
func (*Manager) Resolve ¶
func (m *Manager) Resolve(ctx context.Context, dep *Dependency) (*ResolveResult, error)
Resolve resolves a dependency
type ResolveError ¶
type ResolveError struct {
Dependency *Dependency
Source Source
URL string
Operation string // "download", "resolve", "validate"
Err error
}
ResolveError provides detailed error information for dependency resolution failures
func (*ResolveError) Error ¶
func (e *ResolveError) Error() string
func (*ResolveError) Unwrap ¶
func (e *ResolveError) Unwrap() error
type ResolveResult ¶
type ResolveResult struct {
LocalPath string // local path to the resolved dependency
Version string // resolved version
Changed bool // whether the dependency was updated
}
ResolveResult contains the result of dependency resolution
type Source ¶
type Source string
Source represents the dependency source type
const ( SourceAuto Source = "" // auto-detect SourceGoMod Source = "gomod" // Go module (default) SourceGit Source = "git" // Git repository SourceHTTP Source = "http" // HTTP/HTTPS (supports archives) SourceS3 Source = "s3" // AWS S3 SourceGCS Source = "gcs" // Google Cloud Storage SourceLocal Source = "local" // Local path )
Supported source types.
func DetectSource ¶
DetectSource auto-detects the source type based on URL patterns (public API)
func (Source) DisplayName ¶
DisplayName returns a human-readable name for the source type.