version

package
v0.1.105 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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
}

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) 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

Jump to

Keyboard shortcuts

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