Documentation
¶
Index ¶
- Variables
- type Collection
- type Version
- func (v *Version) AirgapDownloadURL(arch string) string
- func (v *Version) Compare(b *Version) int
- func (v *Version) DocsURL() string
- func (v *Version) DownloadURL(os, arch string) string
- func (v *Version) Equal(b *Version) bool
- func (v *Version) GreaterThan(b *Version) bool
- func (v *Version) GreaterThanOrEqual(b *Version) bool
- func (v *Version) LessThan(b *Version) bool
- func (v *Version) LessThanOrEqual(b *Version) bool
- func (v *Version) String() string
- func (v *Version) URL() string
Constants ¶
This section is empty.
Variables ¶
var BaseUrl = "https://github.com/k0sproject/k0s/"
var Timeout = time.Second * 10
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection []*Version
Collection is a type that implements the sort.Interface interface so that versions can be sorted.
func NewCollection ¶
func NewCollection(versions ...string) (Collection, error)
func (Collection) Len ¶
func (v Collection) Len() int
func (Collection) Less ¶
func (v Collection) Less(i, j int) bool
func (Collection) Swap ¶
func (v Collection) Swap(i, j int)
type Version ¶
Version is a k0s version
func Latest ¶ added in v0.3.0
LatestVersion returns the semantically sorted latest version even if it is a prerelease from the online repository
func LatestByPrerelease ¶ added in v0.3.0
LatestByPrerelease returns the latest released k0s version, if preok is true, prereleases are also accepted.
func LatestStable ¶ added in v0.3.0
LatestStable returns the semantically sorted latest non-prerelease version from the online repository
func NewVersion ¶
NewVersion returns a new Version created from the supplied string or an error if the string is not a valid version number
func (*Version) AirgapDownloadURL ¶ added in v0.3.0
AirgapDownloadURL returns the k0s airgap bundle download URL for the k0s version
func (*Version) Compare ¶
Compare compares two versions and returns one of the integers: -1, 0 or 1 (less than, equal, greater than)
func (*Version) DownloadURL ¶ added in v0.3.0
DownloadURL returns the k0s binary download URL for the k0s version
func (*Version) GreaterThan ¶
GreaterThan returns true if the version is greater than the supplied version
func (*Version) GreaterThanOrEqual ¶
GreaterThanOrEqual returns true if the version is greater than the supplied version or equal
func (*Version) LessThanOrEqual ¶
LessThanOrEqual returns true if the version is lower than the supplied version or equal