version

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package version provides a simple way to parse versions.

Index

Constants

This section is empty.

Variables

View Source
var Unknown = Version{}

Unknown is the unknown version.

Functions

func AddPrefixV added in v0.2.0

func AddPrefixV(version string) string

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

func TrimPrefixV(version string) string

TrimPrefixV returns the version without the prefix 'v'.

Types

type Version

type Version = semver.Version

Version represents a semver compatible version

func NewVersion

func NewVersion(major, minor, patch uint64) Version

NewVersion creates a new version.

func ParseFromBinary

func ParseFromBinary(ctx context.Context, path string) (Version, error)

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

func ParseFromOutput(s string) (Version, error)

ParseFromOutput parses the version from the output.

func ParseVersion added in v0.2.0

func ParseVersion(s string) (Version, error)

ParseVersion parses the version.

Jump to

Keyboard shortcuts

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