version

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 3 Imported by: 0

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

func (info Info) String() string

String returns a Go-syntax representation of the Info.

type ReleaseVersion

type ReleaseVersion struct {
	*utilversion.Version
}

ReleaseVersion represents a released version.

func ParseGitVersion

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

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

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