proxy

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultURL = "https://proxy.golang.org"

Functions

func IsNotFound added in v1.1.0

func IsNotFound(err error) bool

IsNotFound returns true if the error is ModuleNotFound

Types

type Module

type Module struct {
	Module  string
	Version string
}

Module is the module, and it's version returned from @latest

type ModuleNotFound

type ModuleNotFound struct {
	Path string
}

func (ModuleNotFound) Error

func (err ModuleNotFound) Error() string

type Proxy

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

func New

func New(url string) *Proxy

func (*Proxy) EnsureDownloaded added in v1.1.0

func (proxy *Proxy) EnsureDownloaded(mod, ver, dir string) (string, error)

func (*Proxy) GetLatestVersion

func (proxy *Proxy) GetLatestVersion(modulePath string) (Module, error)

GetLatestVersion returns the latest version for a module from the proxy. Will return an error of type ModuleNotFound if no module exists for the given path

func (*Proxy) ResolveDeps

func (proxy *Proxy) ResolveDeps(mods, newMods []*Module) ([]*Module, error)

ResolveDeps will resolve the dependencies of a module list following the minimum viable version strategy

func (*Proxy) ResolveModuleForPackage

func (proxy *Proxy) ResolveModuleForPackage(pattern string) (*Module, error)

ResolveModuleForPackage tries to determine the module name for a given package pattern

Jump to

Keyboard shortcuts

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