semver

package
v0.0.0-...-b427cc5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalOnlyReleaseType is returned when a requested release type is for internal use only
	ErrInternalOnlyReleaseType = errors.New("release type is for internal use only")
	// ErrUnknownReleaseType is returned when a requested release type is unknown
	ErrUnknownReleaseType = errors.New("unknown release type")
)

Functions

func Increment

func Increment(in string, rt ReleaseType, ident string) (string, error)

Increment returns the version incremented by the release type. This function largely mimics the increment logic found in https://github.com/npm/node-semver

func List

func List(in []string) ([]string, error)

List takes a collection of raw version values and returns a list of valid versions

func Major

func Major(in string) (uint64, error)

Major returns the major version number

func Minor

func Minor(in string) (uint64, error)

Minor returns the minor version number

func Patch

func Patch(in string) (uint64, error)

Patch returns the patch version number

func Prerelease

func Prerelease(in string) ([]string, error)

Prerelease returns an array of prerelease components or nil if none exist

func SortedList

func SortedList(in []string) ([]string, error)

SortedList takes a collection of raw version values and returns a sorted list of valid versions

func Valid

func Valid(in string) (string, error)

Valid returns a parsed version or an error if it's not valid

Types

type ReleaseType

type ReleaseType int

func ToReleaseType

func ToReleaseType(rt string) (ReleaseType, error)

ToReleaseType is a convenience function for getting a valid ReleaseType

func (ReleaseType) String

func (t ReleaseType) String() string

String is the string representation of a ReleaseType

Jump to

Keyboard shortcuts

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