semver

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SemverRegex = `` /* 178-byte string literal not displayed */

Functions

This section is empty.

Types

type Semver

type Semver struct {
	Major         int    `validate:"gte=0"`
	Minor         int    `validate:"gte=0"`
	Patch         int    `validate:"gte=0"`
	BuildMetadata string `validate:"omitempty,alphanumunicode"`
}

func NewSemver

func NewSemver(major, minor, patch int, metadata string) (*Semver, error)

func NewSemverFromGitTag

func NewSemverFromGitTag(tag *object.Tag) (*Semver, error)

NewSemverFromGitTag returns a semver struct corresponding to the Git annotated tag used as an input.

func (*Semver) BumpMajor

func (s *Semver) BumpMajor()

func (*Semver) BumpMinor

func (s *Semver) BumpMinor()

func (*Semver) BumpPatch

func (s *Semver) BumpPatch()

func (Semver) IsZero

func (s Semver) IsZero() bool

func (Semver) NormalVersion

func (s Semver) NormalVersion() string

func (Semver) Precedence

func (s1 Semver) Precedence(s2 Semver) int

Precedence returns an integer representing which of the two versions s1 or s2 is the most recent. 1 meaning s1 is the most recent, -1 that it is s2 and 0 that they are equal.

func (Semver) String

func (s Semver) String() string

Jump to

Keyboard shortcuts

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