version

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(output io.Writer) *cobra.Command

NewCommand returns a cobra command for fetching versions.

func NewCommandWithVersionGetter

func NewCommandWithVersionGetter(output io.Writer, getVersions func() (Versions, error)) *cobra.Command

NewCommandWithVersionGetter returns a custom cobra command for fetching versions.

Types

type Version

type Version struct {
	Major        string `json:"major"`
	Minor        string `json:"minor"`
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	CommitDate   string `json:"commitDate"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

Version is a struct for version information.

func GetVersion

func GetVersion() Version

GetVersion returns this binary's version.

type Versions

type Versions = map[string]Version

Versions is a map of multiple components' version information.

Jump to

Keyboard shortcuts

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