version

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSemVer is returned if a version can not be parsed
	ErrInvalidSemVer = errors.New("invalid semantic version")

	// ErrUnsupportedVer is returned if a version out of supported range
	ErrUnsupportedVer = errors.New("the version is out of supported range")
)

Functions

This section is empty.

Types

type Version

type Version struct {
	Major, Minor uint64
}

func New

func New(v string) (*Version, error)

func (*Version) Compare

func (v *Version) Compare(o *Version) int

Compare compares this version to another one. It returns -1, 0, or 1 if the version smaller, equal, or larger than the other version.

func (*Version) Greater

func (v *Version) Greater(o *Version) bool

Greater tests if one version is greater than another one

func (*Version) GreaterOrEqual

func (v *Version) GreaterOrEqual(o *Version) bool

GreaterOrEqual tests if one version is greater than another one or equal

func (*Version) InRange

func (v *Version) InRange(s, e *Version) bool

InRange tests if version is in range in another one

func (*Version) Less

func (v *Version) Less(o *Version) bool

Less tests if one version is less than another one

func (*Version) LessOrEqual

func (v *Version) LessOrEqual(o *Version) bool

LessOrEqual tests if one version is less than another one or equal

func (*Version) Validate

func (v *Version) Validate() error

Jump to

Keyboard shortcuts

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