Documentation ¶
Overview ¶
Package versions provides helpful methods for anything related to the versions in eclectica
Index ¶
- func Complete(version string, vers []string) (string, error)
- func Compose(versions []string) map[string][]string
- func ComposeMajors(versions []string) map[string][]string
- func ComposeMinors(versions []string) map[string][]string
- func GetElements(key string, versions map[string][]string) []string
- func GetKeys(versions map[string][]string) []string
- func HasMinor(version string) bool
- func HasOnlyMajor(version string) bool
- func IsPartial(version string) bool
- func Latest(version string, versions []string) (string, error)
- func Semverify(version string) string
- func Unsemverify(version string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeMajors ¶
ComposeMajors majors version to map object of arrays from array
func ComposeMinors ¶
ComposeMinors composes minor version to map object of arrays from array
func GetElements ¶
GetElements gets all elements for provided range of version in sorted semver format:
map[string][]string{ "1.x": string{1.1, 1.1-beta} }
Will return:
[1.1.0, 1.1.0-beta]
func GetKeys ¶
GetKeys returns array of keys
map[string][]string{"4.x": []string{}, "0.x": []string{"0.8.2"}}
gets you:
string{"0.x", "4.x"}
func HasOnlyMajor ¶
HasOnlyMajor checks if provided version has only major number in it
func Latest ¶
Latest returns latest version from provided list "1.x" with [1.1.0, 1.1.1-beta, 1.1.1-rc2, 1.0, 1.1.1] will return "1.1.1", same for "latest" with [1.1.0, 1.1.1-beta, 1.1.1-rc2, 1.0, 1.1.1]
func Unsemverify ¶
Unsemverify will do its best to unsemverify a string "1.8.0-beta2" -> "1.8-beta2"
Types ¶
This section is empty.