gomod

package
v0.0.0-...-342267f Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoMod

type GoMod struct {
	IncludeIndirect bool
	ProxyLoader     Queryer
	Logger          logger
}

GoMod represents a Go Modules parser. Running LoadAndComputePairs with a filename will return a slice of parsed dependencies.

func (*GoMod) LoadAndComputePairs

func (g *GoMod) LoadAndComputePairs(filename string) ([]libyear.Pair, error)

LoadAndComputePairs takes a filename of a go.mod file, runs the resolution algorithm in the provided Querier, and returns parsed pairs of dependencies and their latest versions.

type Queryer

type Queryer struct {
	Root   string
	Client http.Client
	Cache  cache.Cache
	Logger logger
}

A Queryer holds settings for a

func (*Queryer) GetLatestVersion

func (q *Queryer) GetLatestVersion(module string) libyear.Info

GetLatestVersion returns the "latest" major version of a module, jumping across MVS boundaries: i.e. github.com/foo/bar => github.com/foo/bar/v2 in the case of one version bump github.com/foo/baz/v2 => github.com/foo/baz/v6 in the case of a large jump github.com/foo/quuz/v2 => github.com/foo/quuz/v2 in the case of no jump at all.

func (*Queryer) GetVersion

func (q *Queryer) GetVersion(module string, version string) libyear.Info

GetVersion returns the proxy's information about a given version of a module. `module` in this case is a fully-disambiguated MVS name (github.com/foo/bar/v2), and `version` is a version identifier as defined in `https://blog.golang.org/publishing-go-modules#TOC_3.`

Jump to

Keyboard shortcuts

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