version

package
v0.1.129 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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.

func IsCalVer

func IsCalVer(v Version) bool

flag to indicate which side of the semver to calver migration we're on. drop when we're done

Types

type InvalidVersionError

type InvalidVersionError struct {
	// contains filtered or unexported fields
}

func (*InvalidVersionError) Error

func (e *InvalidVersionError) Error() string

type Version

type Version struct {
	Major     int
	Minor     int
	Patch     int
	Build     int
	Channel   string
	BuildMeta string
}

func New

func New(t time.Time, channel string, buildNum int) Version

func Parse

func Parse(version string) (Version, error)

func (Version) Equal

func (v Version) Equal(other Version) bool

func (Version) Increment

func (v Version) Increment(t time.Time) Version

func (Version) MarshalJSON added in v0.1.109

func (v Version) MarshalJSON() ([]byte, error)

func (Version) Newer

func (v Version) Newer(other Version) bool

func (Version) Older

func (v Version) Older(other Version) bool

func (Version) SignificantlyBehind

func (v Version) SignificantlyBehind(latest Version) bool

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalJSON added in v0.1.109

func (v *Version) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL