semver

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SemVer

type SemVer struct {
	// contains filtered or unexported fields
}

SemVer implements Semantic Versioning according to https://semver.org.

func NewSemVer

func NewSemVer(major uint16, minor uint16, patch uint16) *SemVer

NewSemVer creates a new SemVer from the given major, minor and patch versions.

func NewSemVerFromString

func NewSemVerFromString(versionString string) (*SemVer, error)

NewSemVerFromString creates a new SemVer from the given version string and returns an error on failure.

func (*SemVer) AtLeast

func (version *SemVer) AtLeast(fromVersion *SemVer) bool

AtLeast checks whether this version is equal to or higher than fromVersion.

func (*SemVer) Between

func (version *SemVer) Between(fromVersion *SemVer, toVersion *SemVer) bool

Between checks whether this version is between the from-version (including) and the to-version (excluding).

func (SemVer) MarshalJSON

func (version SemVer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*SemVer) String

func (version *SemVer) String() string

func (*SemVer) UnmarshalJSON

func (version *SemVer) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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