version

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	BuildDate    string `json:"buildDate"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

Info contains versioning information.

func Get

func Get() Info

Get returns the overall codebase version. It's for detecting what code a binary was built from.

func (Info) String added in v0.9.0

func (info Info) String() string

String returns a Go-syntax representation of the Info.

type ReleaseVersion added in v1.0.2

type ReleaseVersion struct {
	*utilversion.Version
}

ReleaseVersion represents a released version.

func ParseGitVersion added in v1.0.2

func ParseGitVersion(gitVersion string) (*ReleaseVersion, error)

ParseGitVersion parses a git version string, such as: - v1.1.0-73-g7e6d4f69 - v1.1.0 - v1.1.0-alpha.1-3-gf20c721a

func (*ReleaseVersion) ReleaseVersion added in v1.7.0

func (r *ReleaseVersion) ReleaseVersion() string

ReleaseVersion returns the parsed version in the following format: - v1.2.1-12-g2eb92858 --> v1.2.1 - v1.2.3-12-g2e860210 --> v1.2.3 - v1.3.0-alpha.1-12-g2e860210 --> v1.3.0-alpha.1 It could be patch release or pre-release

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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