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") // ErrNoValidSemVerFound return a error when the versions list is empty ErrNoValidSemVerFound error = errors.New("no valid semantic version found") )
var ( // SupportedKind holds a list of supported version kind SupportedKind []string = []string{ REGEXVERSIONKIND, SEMVERVERSIONKIND, LATESTVERSIONKIND, } )
Functions ¶
This section is empty.
Types ¶
type ErrIncorrectSemVerConstraint ¶ added in v0.55.0
type ErrIncorrectSemVerConstraint struct {
SemVerConstraint string
}
ErrUnsupportedVersionKind returns when the provided combination of version and pattern filter is unsupported
func (*ErrIncorrectSemVerConstraint) Error ¶ added in v0.55.0
func (e *ErrIncorrectSemVerConstraint) Error() string
type ErrNoVersionFoundForPattern ¶ added in v0.55.0
type ErrNoVersionFoundForPattern struct {
Pattern string
}
ErrNoVersionFoundForPattern returns when a given pattern does not find any version
func (*ErrNoVersionFoundForPattern) Error ¶ added in v0.55.0
func (e *ErrNoVersionFoundForPattern) Error() string
type ErrUnsupportedVersionKind ¶ added in v0.55.0
type ErrUnsupportedVersionKind struct {
Kind string
}
ErrUnsupportedVersionKind returns when the provided version filter is unsupported
func (*ErrUnsupportedVersionKind) Error ¶ added in v0.55.0
func (e *ErrUnsupportedVersionKind) Error() string
type ErrUnsupportedVersionKindPattern ¶ added in v0.55.0
ErrUnsupportedVersionKind returns when the provided combination of version and pattern filter is unsupported
func (*ErrUnsupportedVersionKindPattern) Error ¶ added in v0.55.0
func (e *ErrUnsupportedVersionKindPattern) Error() string
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.