Documentation ¶
Overview ¶
Package version provides a simple way to parse versions.
Index ¶
- Variables
- func AddPrefixV(version string) string
- func DefaultUserAgent() string
- func DisplayVersion() string
- func TrimPrefixV(version string) string
- type Version
- func NewVersion(major, minor, patch uint64) Version
- func ParseFromBinary(ctx context.Context, path string) (Version, error)
- func ParseFromImage(ctx context.Context, runtime string, image string, command string) (Version, error)
- func ParseFromOutput(s string) (Version, error)
- func ParseVersion(s string) (Version, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Unknown = Version{}
Unknown is the unknown version.
Functions ¶
func AddPrefixV ¶ added in v0.2.0
AddPrefixV returns the version with the prefix 'v'.
func DefaultUserAgent ¶ added in v0.2.0
func DefaultUserAgent() string
DefaultUserAgent returns a User-Agent string built from static global vars.
func DisplayVersion ¶ added in v0.2.0
func DisplayVersion() string
DisplayVersion is the version string for the current build
func TrimPrefixV ¶ added in v0.2.0
TrimPrefixV returns the version without the prefix 'v'.
Types ¶
type Version ¶
type Version = semver.Version
Version represents a semver compatible version
func NewVersion ¶
NewVersion creates a new version.
func ParseFromBinary ¶
ParseFromBinary parses the version from the binary.
func ParseFromImage ¶
func ParseFromImage(ctx context.Context, runtime string, image string, command string) (Version, error)
ParseFromImage parses the version from the image.
func ParseFromOutput ¶
ParseFromOutput parses the version from the output.
func ParseVersion ¶ added in v0.2.0
ParseVersion parses the version.
Click to show internal directories.
Click to hide internal directories.