depresolver

package
v0.1.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

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

func NewManager(cacheDir, gomodPath string) *Manager

NewManager creates a new dependency manager

func (*Manager) CacheDir

func (m *Manager) CacheDir() string

CacheDir returns the cache directory

func (*Manager) CleanCache

func (m *Manager) CleanCache() error

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

func DetectSource(url string) Source

DetectSource auto-detects the source type based on URL patterns (public API)

func (Source) DisplayName

func (s Source) DisplayName() string

DisplayName returns a human-readable name for the source type.

Jump to

Keyboard shortcuts

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