Documentation
¶
Index ¶
- func CompareVersions(v1, v2 string) int
- func IsUpdateAvailable(current, latest string) bool
- func ShouldUpdate(current, latest string) bool
- type Version
- func (v *Version) Build() string
- func (v *Version) Clean() string
- func (v *Version) Compare(other *Version) int
- func (v *Version) Equals(other *Version) bool
- func (v *Version) FullString() string
- func (v *Version) IsNewerThan(other *Version) bool
- func (v *Version) IsOlderThan(other *Version) bool
- func (v *Version) IsPreRelease() bool
- func (v *Version) IsStable() bool
- func (v *Version) IsValid() bool
- func (v *Version) Major() int64
- func (v *Version) Minor() int64
- func (v *Version) Patch() int64
- func (v *Version) PreRelease() string
- func (v *Version) Raw() string
- func (v *Version) Satisfies(constraint string) bool
- func (v *Version) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions is a convenience function to compare two version strings
func IsUpdateAvailable ¶
IsUpdateAvailable is an alias for ShouldUpdate
func ShouldUpdate ¶
ShouldUpdate determines if an update is available current is the currently installed version latest is the available version
Types ¶
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a semantic version with parsing and comparison capabilities
func LatestStable ¶
LatestStable returns the latest stable version from a list
func NewVersion ¶
NewVersion creates a new Version from a raw string
func (*Version) Compare ¶
Compare compares this version with another Returns:
1 if v > other (v is newer) 0 if v == other
1 if v < other (other is newer) 2 if either version is invalid
func (*Version) FullString ¶
FullString returns the complete version with pre-release and build
func (*Version) IsNewerThan ¶
IsNewerThan checks if this version is newer than the other
func (*Version) IsOlderThan ¶
IsOlderThan checks if this version is older than the other
func (*Version) IsPreRelease ¶
IsPreRelease returns true if version is alpha/beta/rc
func (*Version) PreRelease ¶
PreRelease returns the pre-release identifier