modproxy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextMajor

func NextMajor(version string) (string, error)

NextMajor returns the next major version after the provided version

Types

type Module

type Module struct {
	Path     string
	Versions []string
}

Module contains the module path and versions

func Latest

func Latest(modpath string, cached bool) (*Module, error)

Latest finds the latest major version of a module cached sets the Disable-Module-Fetch: true header

func Query

func Query(modpath string, cached bool) (*Module, bool, error)

Query the module proxy for all versions of a module. If the module does not exist, the second return parameter will be false cached sets the Disable-Module-Fetch: true header

func QueryPackage

func QueryPackage(pkgpath string, cached bool) (*Module, error)

QueryPackage tries to find the module path for the provided package path it does so by repeatedly chopping off the last path element and trying to use it as a path.

func (*Module) MaxVersion

func (m *Module) MaxVersion(prefix string, pre bool) string

MaxVersion returns the latest version. If there are no versions, the empty string is returned. Prefix can be used to filter the versions based on a prefix. If pre is false, pre-release versions will are excluded.

func (*Module) NextMajorPath

func (m *Module) NextMajorPath() (string, bool)

NextMajorPath returns the module path of the next major version

func (*Module) WithMajorPath added in v0.3.0

func (m *Module) WithMajorPath(version string) string

WithMajorPath returns the module path for the provided version

Jump to

Keyboard shortcuts

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