version

package
v0.0.0-...-5923d8e Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Major is the position in the slice of the major value.
	Major = iota
	// Minor is the position in the slice of the minor value.
	Minor
	// Patch is the position in the slice of the patch value.
	Patch
	// Pre is the position in the slice of the pre value.
	Pre

	// RegExPatternVersionString is the RegEX to parse the version string and detected the major, minor, patch and pre version.
	RegExPatternVersionString = `((\d+)\.(\d+)\.(\d+))(?:-RC\.?([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version []uint

Version is the abstraction of the version.

func New

func New(v string) (Version, error)

New creates an new instance of the version.

func (Version) Byte

func (v Version) Byte() (version uint)

Byte returns the value of the version as byte type.

func (Version) Increase

func (v Version) Increase(major, minor, patch, pre bool)

Increase increase the semantic version by the values of major, minor, patch and pre.

func (*Version) IncreasePre

func (v *Version) IncreasePre(pre bool)

IncreasePre increase the release candidate value of the version.

func (Version) IsReleaseCandidate

func (v Version) IsReleaseCandidate() bool

IsReleaseCandidate validates the version for a release candidate.

func (Version) String

func (v Version) String() (version string)

String returns the version as string.

type Versions

type Versions []Version

Versions is the collection of version.

func (Versions) Len

func (versions Versions) Len() int

Len is the number of elements in the collection.

func (Versions) Less

func (versions Versions) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (Versions) Swap

func (versions Versions) Swap(i, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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