appversion

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package appversion unifies common versions for all binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fprint

func Fprint(w io.Writer)

Fprint prints version information to writer.

func Print

func Print()

Print prints version information to stdout.

func PrintExit

func PrintExit()

PrintExit prints version to stdout and os.Exit(0) if have `-version` flag. Call it after `flag.Parse()`.

func VersionFlag

func VersionFlag() bool

VersionFlag indicate whether expect to print version and exit. Call it after `flag.Prase()` to make sure command line parameters available.

Types

type VersionInfo

type VersionInfo struct {
	AppVersion string `json:"app version"`
	BuildTime  string `json:"build time"`
	GitCommit  string `json:"git commit"`
}

VersionInfo represents version information structure.

func Version

func Version() VersionInfo

Version returns version information.

Jump to

Keyboard shortcuts

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