version

package
v0.0.0-...-fd0897c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package version provides build version information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CobraCommand

func CobraCommand() *cobra.Command

CobraCommand returns a command used to print version information.

Types

type BuildInfo

type BuildInfo struct {
	Version       string `json:"version"`
	GitRevision   string `json:"revision"`
	User          string `json:"user"`
	Host          string `json:"host"`
	GolangVersion string `json:"golang_version"`
	DockerHub     string `json:"hub"`
	BuildStatus   string `json:"status"`
}

BuildInfo describes version information about the binary build.

var (
	// Info exports the build version information.
	Info BuildInfo
)

func (BuildInfo) LongForm

func (b BuildInfo) LongForm() string

LongForm returns a multi-line version information

This looks like:

``` Version: <version> GitRevision: <git revision> User: user@host Hub: <docker hub> GolangVersion: go1.9.2 BuildStatus: <build status> ```

func (BuildInfo) String

func (b BuildInfo) String() string

String produces a single-line version info

This looks like:

``` user@host-<docker hub>-<version>-<git revision>-<build status> ```

Jump to

Keyboard shortcuts

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