versions

package
v0.16.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidVersion is returned when a version string doesn't meet the
	// requirements of a Wolfi-compatible version.
	ErrInvalidVersion = errors.New("not a valid Wolfi package version")

	// ErrInvalidFullVersion is returned when a version string doesn't meet the
	// requirements of a Wolfi-compatible "full" version (which should include the
	// epoch suffix).
	ErrInvalidFullVersion = errors.New("not a valid full Wolfi package version (with epoch)")
)

Functions

func NewVersion

func NewVersion(v string) (*version.Version, error)

NewVersion some older versions in wolfi contain an underscore to separate pre-release

func ValidateWithEpoch added in v0.5.1

func ValidateWithEpoch(v string) error

ValidateWithEpoch checks if the given package version, which is expected to include the epoch component, is a Wolfi-compatible "full" version. It returns an error if not.

func ValidateWithoutEpoch added in v0.5.1

func ValidateWithoutEpoch(v string) error

ValidateWithoutEpoch checks if the given package version, which is expected NOT to include the epoch component, is a Wolfi-compatible version. It returns an error if not.

Types

type ByLatest

type ByLatest []*version.Version

func (ByLatest) Len

func (u ByLatest) Len() int

func (ByLatest) Less

func (u ByLatest) Less(i, j int) bool

func (ByLatest) Swap

func (u ByLatest) Swap(i, j int)

type ByLatestStrings

type ByLatestStrings []string

ByLatestStrings is like ByLatest but lets the user pass in strings instead of Version objects.

func (ByLatestStrings) Len

func (by ByLatestStrings) Len() int

func (ByLatestStrings) Less

func (by ByLatestStrings) Less(i, j int) bool

func (ByLatestStrings) Swap

func (by ByLatestStrings) Swap(i, j int)

type Interface

type Interface interface {
	// Len is the number of elements in the collection.
	Len() int

	// Less reports whether the element with index i must sort before the element with index j.
	// If both Less(i, j) and Less(j, i) are false, then the elements at index i and j are considered equal.
	Less(i, j int) bool

	// Swap swaps the elements with indexes i and j.
	Swap(i, j int)
}

Jump to

Keyboard shortcuts

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