Documentation
¶
Index ¶
- func ChannelFromCalverOrSemver(v Version) string
- func Compare(x Version, y Version) int
- func IsCalVer(v Version) bool
- type InvalidVersionError
- type Version
- func (v Version) Equal(other Version) bool
- func (v Version) Increment(t time.Time) Version
- func (v Version) MarshalJSON() ([]byte, error)
- func (v Version) Newer(other Version) bool
- func (v Version) Older(other Version) bool
- func (v Version) SignificantlyBehind(latest Version) bool
- func (v Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelFromCalverOrSemver ¶ added in v0.1.112
func ChannelFromCalverOrSemver(v Version) string
func Compare ¶
func Compare(x Version, y Version) int
Compare returns
-1 if x is less than y,
0 if x equals y,
+1 if x is greater than y.
Versions with channels are considered less than versions without channels, as per semver spec. If both versions have channels, they are compared as strings. A channel of "stable" is greater than any other channel.
Types ¶
type InvalidVersionError ¶
type InvalidVersionError struct {
// contains filtered or unexported fields
}
type Version ¶
type Version struct {
Major int
Minor int
Patch int
Build int
Channel string
BuildMeta string
}
func (Version) MarshalJSON ¶ added in v0.1.109
func (v Version) MarshalJSON() ([]byte, error)
func (Version) SignificantlyBehind ¶
func (v Version) SignificantlyBehind(latest Version) bool
func (*Version) UnmarshalJSON ¶ added in v0.1.109
func (v *Version) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.