version

package
v0.4.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 9

Documentation

Overview

Package version implements version handling.

Index

Constants

This section is empty.

Variables

View Source
var (
	// KubeSemver is the regex for Kubernetes versions. It requires the "v" prefix.
	KubeSemver = regexp.MustCompile(`^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`)
	// KubeSemverTolerant is the regex for Kubernetes versions with an optional "v" prefix.
	KubeSemverTolerant = regexp.MustCompile(`^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`)
)

Functions

func ParseMajorMinorPatch

func ParseMajorMinorPatch(version string) (semver.Version, error)

ParseMajorMinorPatch returns a semver.Version from the string provided by looking only at major.minor.patch and stripping everything else out. It requires the version to have a "v" prefix.

func ParseMajorMinorPatchTolerant

func ParseMajorMinorPatchTolerant(version string) (semver.Version, error)

ParseMajorMinorPatchTolerant returns a semver.Version from the string provided by looking only at major.minor.patch and stripping everything else out. It does not require the version to have a "v" prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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