version

package
v2.0.0-beta2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: AGPL-3.0 Imports: 5 Imported by: 1

Documentation

Overview

Package version provides helpers for working with versions and build info.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Component name, e.g. "pmm-managed" or "mongodb_exporter".
	// {{ .ProjectName }} for GoReleaser.
	ProjectName string

	// Component version, e.g. "2.1.2-beta1" for pmm-managed or "0.6.3" for mongodb_exporter.
	// {{ .Version }} for GoReleaser.
	Version string

	// PMM version. Empty for non-PMM builds.
	// For example, "2.1.2-beta1" for mongodb_exporter when built with PMM Client, empty otherwise.
	PMMVersion string

	// Build UNIX timestamp, e.g. "1545226908".
	// {{ .Timestamp }} for GoReleaser.
	Timestamp string

	// Full git commit hash, e.g. "6559a94ab33831deeda04193f74413b735edb1a1".
	// {{ .FullCommit }} for GoReleaser.
	FullCommit string

	// Git branch name, e.g. "master".
	Branch string
)

https://goreleaser.com/templates/

Functions

func FullInfo

func FullInfo() string

FullInfo returns multi-line version information.

func ShortInfo

func ShortInfo() string

ShortInfo returns project name and short version as one line.

Types

type Info

type Info struct {
	Major int
	Minor int
	Patch int
	Rest  string // pre-release version and/or build metadata
}

func Parse

func Parse(version string) (Info, error)

func (*Info) Less

func (i *Info) Less(right *Info) bool

Less returns true of this (left) Version is less than right.

func (Info) String

func (i Info) String() string

Jump to

Keyboard shortcuts

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