Documentation ¶
Index ¶
Constants ¶
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 ¶
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