gomod

package
v0.0.0-...-e308f56 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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r *strategy.Registry, cloneManager gitclone.ManagerProvider)

func VersionToGitRef

func VersionToGitRef(version string) string

VersionToGitRef converts a Go module version string to a git ref. For pseudo-versions (e.g. v0.0.0-20160603174536-ad42235f7e24), it extracts the commit hash suffix. For all other versions (tagged releases, pre-releases, +incompatible), it returns the version unchanged.

Types

type CompositeFetcher

type CompositeFetcher struct {
	// contains filtered or unexported fields
}

CompositeFetcher routes module requests to either public or private fetchers based on module path patterns.

func NewCompositeFetcher

func NewCompositeFetcher(
	publicFetcher goproxy.Fetcher,
	privateFetcher goproxy.Fetcher,
	patterns []string,
) *CompositeFetcher

func (*CompositeFetcher) Download

func (c *CompositeFetcher) Download(ctx context.Context, path, version string) (info, mod, zip io.ReadSeekCloser, err error)

func (*CompositeFetcher) IsPrivate

func (c *CompositeFetcher) IsPrivate(modulePath string) bool

func (*CompositeFetcher) List

func (c *CompositeFetcher) List(ctx context.Context, path string) (versions []string, err error)

func (*CompositeFetcher) Query

func (c *CompositeFetcher) Query(ctx context.Context, path, query string) (version string, t time.Time, err error)

type Config

type Config struct {
	Proxy        string   `hcl:"proxy,optional" help:"Upstream Go module proxy URL (defaults to proxy.golang.org)" default:"https://proxy.golang.org"`
	PrivatePaths []string `hcl:"private-paths,optional" help:"Module path patterns for private repositories"`
}

type Strategy

type Strategy struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config Config, cache cache.Cache, mux strategy.Mux, cloneManagerProvider gitclone.ManagerProvider) (*Strategy, error)

func (*Strategy) String

func (s *Strategy) String() string

Jump to

Keyboard shortcuts

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