Documentation ¶
Index ¶
- Variables
- type Version
- func (v Version) Equals(to Version) bool
- func (v Version) GreaterThan(to Version) bool
- func (v Version) GreaterThanOrEquals(to Version) bool
- func (v Version) LowerThan(to Version) bool
- func (v Version) LowerThanOrEquals(to Version) bool
- func (v Version) NotEquals(to Version) bool
- func (v Version) ShouldUpdate(to Version) bool
- func (v Version) String() string
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidVersion = errors.New("invalid semantic version format")
ErrInvalidVersion is the error returned when trying to parse a string that is not semantic versioning compliant.
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version struct { Major string Minor string Patch string // contains filtered or unexported fields }
Version is a structure that holds the representation of a concrete semantic version.
func MustParse ¶
MustParse is the equivalent of ShouldParse but instead of returning an error it directly panics.
func Parse ¶
Parse tries to parse the given string and returns a Version if the string is semantic versioning compliant. The boolean returned indicates whether the string is semantic versioning compliant.
func ShouldParse ¶
ShouldParse is the equivalent of Parse but instead of returning a boolean that indicates whether the string is semantic versioning compliant, it returns an error.
func (Version) GreaterThan ¶
GreaterThan returns true if the version is greater than the given version.
func (Version) GreaterThanOrEquals ¶
GreaterThanOrEquals returns true if the version is greater than or equal to the given version.
func (Version) LowerThanOrEquals ¶
LowerThanOrEquals returns true if the version is lower than or equal to the given version.
func (Version) ShouldUpdate ¶
ShouldUpdate returns true if the version should be updated to the given version.