Documentation ¶
Index ¶
- Variables
- func Current() string
- func GetBuildMeta() string
- func GetGitCommit() string
- func GetVersion() string
- func GetVersionDetails() string
- func IsNotVersioned(given string) bool
- func IsVersioned(given string) bool
- func NewVersionCollector(program string) *prometheus.GaugeVec
- func WithSuffix(given string) (suffixed string)
- func WithSuffixIf(given string, p func(string) bool) (suffixed string)
- func WithSuffixesIf(given []string, p func(string) bool) (suffixed []string)
Constants ¶
This section is empty.
Variables ¶
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 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 ¶
IsNotVersioned returns true if the given string does not have version as its suffix
func IsVersioned ¶
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 ¶
WithSuffix appends current version to the provided string
func WithSuffixIf ¶
WithSuffixIf appends current version to the provided string if given predicate succeeds
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 |