semver

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NonePattern is the empty pattern
	NonePattern = Pattern{}
)
View Source
var (

	// NoneVersion is the empty semver
	NoneVersion = Version{}
)

Functions

This section is empty.

Types

type NonFinalVersion added in v1.9.0

type NonFinalVersion int

NonFinalVersion is a detail for temporary version

type Pattern added in v1.9.0

type Pattern struct {
	Name string
	// contains filtered or unexported fields
}

Pattern describe a pattern constraint

func NewPattern added in v1.9.0

func NewPattern(name string, constraints ...constraint) Pattern

NewPattern creates new pattern instance

func ParsePattern added in v1.9.0

func ParsePattern(pattern string) (Pattern, error)

ParsePattern parse given constraint to extract pattern matcher

func (Pattern) Check added in v1.9.0

func (p Pattern) Check(version Version) bool

Check verifies is given version match Pattern

type Version

type Version struct {
	Name string `json:"name"`
	// contains filtered or unexported fields
}

Version describe a semantic version

func Parse

func Parse(version string) (Version, error)

Parse given version string into a version

func (Version) Compare

func (v Version) Compare(other Version) string

Compare return version diff in semver nomenclture

func (Version) Equals added in v1.9.0

func (v Version) Equals(other Version) bool

Equals check if two versions are equivalent

func (Version) IsGreater

func (v Version) IsGreater(other Version) bool

IsGreater check if current version is greater than other

Jump to

Keyboard shortcuts

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