common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDependencies

func FindDependencies(m Manager, matches []types.Match) ([]*types.Dependency, error)

FindDependencies provides a common implementation that finds all the dependencies in a loop

func GetLatestTag

func GetLatestTag(input *GetLatestTagInput) (string, error)

GetLatestTag returns the latest tag that is not a pre-release, or the current tag if no such tag exists.

func ListUpgrades

func ListUpgrades(m Manager, matches []types.Match) ([]*types.UpgradeInfo, error)

ListUpgrades provides a common implementation that lists all the upgrades in a loop

Types

type GetLatestTagInput added in v0.3.1

type GetLatestTagInput struct {
	DepName    string
	Tags       []string
	CurrentTag string
	// AllowMajor specifies whether to allow major version upgrade.
	AllowMajor bool
	// Delimiter is optional, used to split the tag, i.e. docker image tag go:1.20-alpine3.18
	Delimiter string
}

GetLatestTagInput holds the input for GetLatestTag.

type Manager

type Manager interface {
	Name() types.PackageManager
	Match(path string) bool
	Parse(match types.Match, data []byte) ([]*types.Dependency, error)

	FindDependencies(matches []types.Match) ([]*types.Dependency, error)
	// ListUpgrades returns a list of upgrades for the given matches.
	// This could be implemented by ListUpgrades in this package, which calls IsUpgradable in a loop.
	// Or it could be implemented by the package manager itself, which may be more efficient.
	ListUpgrades(matches []types.Match) ([]*types.UpgradeInfo, error)
	IsUpgradable(dep types.Dependency) (*types.UpgradeInfo, error)
}

Manager is the interface that all package managers must implement

type MultiVersion added in v0.3.1

type MultiVersion struct {
	Original string
	Parts    []string
}

MultiVersion represents a complex tag.

Jump to

Keyboard shortcuts

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