version

package
v0.0.0-...-dfe2c77 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionNotSet versionValue = iota
	VersionEnabled
	VersionRaw
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(fs *pflag.FlagSet)

func PrintAndExitIfRequested

func PrintAndExitIfRequested()

func Version

func Version(name string, value versionValue, usage string) *versionValue

func VersionVar

func VersionVar(p *versionValue, name string, value versionValue, usage string)

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 the version information of the application

func Get

func Get() Info

func (Info) String

func (info Info) String() string

String returns the version information as a string

func (Info) Text

func (info Info) Text() string

Text returns the version information in a human-readable format

func (Info) ToJSON

func (info Info) ToJSON() string

ToJSON returns the version information as a JSON string

Jump to

Keyboard shortcuts

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