Documentation ¶
Index ¶
Constants ¶
const ( // REGEXVERSIONKIND represents versions as a simple string REGEXVERSIONKIND string = "regex" // SEMVERVERSIONKIND represents versions as a semantic versioning type SEMVERVERSIONKIND string = "semver" // LATESTVERSIONKIND specifies that we are looking for the latest version of an array LATESTVERSIONKIND string = "latest" )
Variables ¶
var ( // ErrNoVersionFound return a error when no version couldn't be found ErrNoVersionFound error = errors.New("no version found") // ErrNoVersionsFound return a error when the versions list is empty ErrNoVersionsFound error = errors.New("versions list empty") )
var ( // SupportedKind holds a list of supported version kind SupportedKind []string = []string{ REGEXVERSIONKIND, SEMVERVERSIONKIND, LATESTVERSIONKIND, } )
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct { // specifies the version kind such as semver, regex, or latest Kind string `yaml:",omitempty"` // specifies the version pattern according the version kind Pattern string `yaml:",omitempty"` // strict enforce strict versioning rule. Only used for semantic versioning at this time Strict bool `yaml:",omitempty"` }
Filter defines parameters to apply different kind of version matching based on a list of versions
func (*Filter) GreaterThanPattern ¶ added in v0.49.0
GreaterThanPattern returns a pattern that can be used to find newer version
type Semver ¶
type Semver struct { Constraint string FoundVersion Version Strict bool // contains filtered or unexported fields }
Semver is an interface in front the masterminds/semver used across the updatecli project
type Version ¶
TODO: Remove this struct once https://github.com/updatecli/updatecli/issues/803 is fixed. Version defines a version from a filter that holds both the original found version and the parsed version (depending on the kind of filter: semantic, text, etc.) Keeping the original found versions is useful when checking for metadata around the version, such as the changelog
func (Version) GetVersion ¶ added in v0.30.0
TODO: Change the receiver of this function to Filter once https://github.com/updatecli/updatecli/issues/803 is fixed.