tag

package
v0.0.0-...-c49e678 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ignore = iota
	KeepMajor
	KeepMinor
)

Variables

This section is empty.

Functions

func IgnoreBetaVersions

func IgnoreBetaVersions(v *semver.Version) bool

IgnoreBetaVersions filters all labels which start with * "rc" - for release-candidate * "beta" - for beta-versions * "alpha" - for alpha-versions

Types

type FilterFunc

type FilterFunc func(*semver.Version) bool

FilterFunc describes a function which filters out semver-versions: a return value of * true - the entry stays * false - the entry gets filtered out

func ApplyFilterList

func ApplyFilterList(list []FilterFunc) FilterFunc

ApplyFilterList returns a tag.FilterFunc which executes all filters in list sequentially. The first `false` return value stops processing the list. Thus, logical "AND" is applied here.

func ConstraintFilter

func ConstraintFilter(c *semver.Constraints) FilterFunc

ConstraintFilter generates a tag.FilterFunc based on a semver.Constraint. The Check() method already has the same interface as required for FilterFunc, hence, just return the function.

func HugeVersionHeuristicFilter

func HugeVersionHeuristicFilter(a *semver.Version, limit int) FilterFunc

HugeVersionHeuristicFilter generates a tag.FilterFunc to filter out unnatural gaps the version numbering in some repos which use a date-format: 20210530. these versions are parsed into 20210530.0.0 and as a result are "bigger" than regular versions and trump those.

n == 1000 seems to be a major, "unnatural" jump in the major version. lets call it a "heuristic".

type List

type List []*semver.Version

List contains semantic versions

func NewFromStrings

func NewFromStrings(tags []string, extraFilter FilterFunc) List

NewFromStrings creates a new List, based upon the string list "tags". In addition, it applies the filter function extraFilter

func (List) Reverse

func (tags List) Reverse()

Reverse reverses the order of the TagList tags

func (List) Sort

func (tags List) Sort()

Sort sorts the list of tags according to semantic versions

Jump to

Keyboard shortcuts

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