version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version provides build version information.

Index

Constants

This section is empty.

Variables

View Source
var (
	// VersionString gets defined by the build system.
	VersionString = "0.0.0"

	// VersionMajor is the current major version.
	VersionMajor int64

	// VersionMinor is the current minor version.
	VersionMinor int64 = 1

	// VersionPatch is the current patch version.
	VersionPatch int64

	// VersionPre indicates a pre release tag.
	VersionPre = "alpha"

	// VersionDev indicates the current commit.
	VersionDev = "0000000"

	// VersionDate indicates the build date.
	VersionDate = "20190214"

	// Version is the version of the current implementation.
	Version *semver.Version
)

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version     string `json:"version"`
	User        string `json:"user"`
	Host        string `json:"host"`
	GoVersion   string `json:"goVersion"`
	BuildStatus string `json:"status"`
	BuildDate   string `json:"buildDate"`
	Compiler    string `json:"compiler"`
	Platform    string `json:"platform"`
}

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> User: user@host GoVersion: go1.10.2 BuildStatus: <build status> BuildDate: <build date> Compiler: <compiler> Platform: <platform> ```

func (BuildInfo) String

func (b BuildInfo) String() string

String produces a single-line version info

This looks like:

``` user@host-<version>-<build status>-<compiler>-<platform> ```

Jump to

Keyboard shortcuts

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