version

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 3 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

func (*ReleaseVersion) FirstMinorRelease added in v1.0.2

func (r *ReleaseVersion) FirstMinorRelease() string

FirstMinorRelease returns the minor release but the patch releases always be 0(vx.y.0). e.g: - v1.2.1-12-g2eb92858 --> v1.2.0 - v1.2.3-12-g2e860210 --> v1.2.0

func (*ReleaseVersion) PatchRelease added in v1.0.2

func (r *ReleaseVersion) PatchRelease() string

PatchRelease returns the stable version with format "vx.y.z".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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