semverutils

package
v0.0.0-...-877fc11 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b string) int

func Latest

func Latest(vers []string) (string, error)

func MatchVersionStrings

func MatchVersionStrings(vers []string, constraints ...*semver.Constraints) (semver.Collection, error)

MatchVersionStrings returns an ordered list of versions filtered by the given constraints. If no constraints a given the complete list is returned. If one given version is no semver version it is ignored for the matching and an additional error describing the parsing errors is returned.

func MatchVersions

func MatchVersions(versions semver.Collection, constraints ...*semver.Constraints) semver.Collection

func SortVersions

func SortVersions(vers []string) error

Types

type VersionCache

type VersionCache map[string]*semver.Version

func (VersionCache) Compare

func (c VersionCache) Compare(a, b string) int

func (VersionCache) Get

func (c VersionCache) Get(v string) (*semver.Version, error)

Jump to

Keyboard shortcuts

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