resolver

package
v0.0.0-...-cf3f34d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver manages the execution of the MVS algorithm. It implements mvs.Reqs

func New

func New(cache *cache.Cache) *Resolver

func (*Resolver) AddRoots

func (res *Resolver) AddRoots(roots ...RootModule)

AddRoots will add root modules (modules that the user directly requested to build) to the resolution. As these modules are in source directories, and not in the cache, their direct dependencies must be supplied within RootModule. Indirect dependencies will be resolved via the cache supplied to New

func (*Resolver) Max

func (res *Resolver) Max(v1, v2 string) string

Max will return whichever version string provided is greater. The special version "" (empty string) is greater than all other versions, and intended for use in root modules which must always be built. The special version "none" is less than all other versions, and represents a module that is not selected for the build.

This implements mvs.Reqs

func (*Resolver) Required

func (res *Resolver) Required(m module.Version) ([]module.Version, error)

Required will list the direct dependencies required by module m. This is part of the mvs.Reqs interface

func (*Resolver) Resolve

func (res *Resolver) Resolve() ([]module.Version, error)

Resolve returns a list of all the module versions required to perform a build.

type RootModule

type RootModule struct {
	Version      module.Version
	Dependencies []module.Version
}

RootModule stores the dependencies of a root (i.e. project) module. In most cases, Version.Version should be "", because roots are unversioned.

Jump to

Keyboard shortcuts

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