semver

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParseError = errors.New("provided string cannot be parsed into semver")

Functions

This section is empty.

Types

type Comparsion

type Comparsion int
const (
	CompareEqual Comparsion = iota
	CompareOldMajor
	CompareNewMajor
	CompareOldMinor
	CompareNewMinor
	CompareOldPatch
	CompareNewPatch
)

type Version

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

func GetPortalLatest

func GetPortalLatest() (Version, error)

func Parse

func Parse(s string) (Version, error)

Parse parses the the provided string into a semver representation.

func (Version) Compare

func (sv Version) Compare(oracle Version) Comparsion

Compare compares the semver against the provided oracle statement. Return -1 if the semver is less than the oracle statement, 1 if the oracle statement is larger than the semver and 0 if they are equal.

func (Version) Major

func (sv Version) Major() int

func (Version) Minor

func (sv Version) Minor() int

func (Version) Patch

func (sv Version) Patch() int

func (Version) String

func (sv Version) String() string

String returns a string representation of the semver.

Jump to

Keyboard shortcuts

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