version

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 6 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GitCommit that was compiled. This will be filled in by the compiler.
	GitCommit string

	// Version show the version number,fill in by the compiler
	Version string

	// VersionMeta is a pre-release marker for the version. If this is "" (empty string)
	// then it means that it is a final release. Otherwise, this is a pre-release
	// such as "dev" (in development), "beta", "rc1", etc.
	VersionMeta string
)

Functions

func Current

func Current() string

Current returns the current version of maya

func GetBuildMeta

func GetBuildMeta() string

GetBuildMeta returns the build type from the global VersionMeta variable. If VersionMeta is unset then from the BUILDMETA file at the root of the repo.

func GetGitCommit

func GetGitCommit() string

GetGitCommit returns the Git commit SHA-1 from the global GitCommit variable. If GitCommit is unset then by calling Git directly.

func GetVersion

func GetVersion() string

GetVersion returns the current version from the global Version variable. If Version is unset then from the VERSION file at the root of the repo.

func GetVersionDetails

func GetVersionDetails() string

func IsNotVersioned

func IsNotVersioned(given string) bool

IsNotVersioned returns true if the given string does not have version as its suffix

func IsVersioned

func IsVersioned(given string) bool

IsVersioned returns true if the given string has version as its suffix

func NewVersionCollector

func NewVersionCollector(program string) *prometheus.GaugeVec

NewVersionCollector returns a collector which exports metrics about current version information. Note: program name should be similar to maya_exporter (with underscore not with dash)

func WithSuffix

func WithSuffix(given string) (suffixed string)

WithSuffix appends current version to the provided string

func WithSuffixIf

func WithSuffixIf(given string, p func(string) bool) (suffixed string)

WithSuffixIf appends current version to the provided string if given predicate succeeds

func WithSuffixesIf

func WithSuffixesIf(given []string, p func(string) bool) (suffixed []string)

WithSuffixesIf appends current version to the provided strings

Types

This section is empty.

Directories

Path Synopsis
NOTE: Some pieces of code was borrowed from: - k8s.io/apimachinery/pkg/version/helpers.go
NOTE: Some pieces of code was borrowed from: - k8s.io/apimachinery/pkg/version/helpers.go

Jump to

Keyboard shortcuts

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