version

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 8 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{

	Major: 255,
}

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 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