version

package
v2.0.0-beta7+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: AGPL-3.0 Imports: 3 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.

func Time

func Time() (time.Time, error)

Time returns parsed Timestamp.

Types

type PackageInfo

type PackageInfo struct {
	Version     string     `json:"version"`
	FullVersion string     `json:"full_version"`
	BuildTime   *time.Time `json:"build_time"`
	Repo        string     `json:"repo"`
}

PackageInfo describes a single package version.

type UpdateCheckResult

type UpdateCheckResult struct {
	Installed       PackageInfo `json:"installed"`
	Latest          PackageInfo `json:"latest,omitempty"`
	UpdateAvailable bool        `json:"update_available"`
}

UpdateCheckResult represents `pmm-update -check` result.

type UpdateInstalledResult

type UpdateInstalledResult struct {
	Installed PackageInfo `json:"installed"`
}

UpdateInstalledResult represents `pmm-update -installed` result.

Jump to

Keyboard shortcuts

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