feat(influxdb): Add global BuildInfo

Permits binary packages to set a global BuildInfo state that
can be inspected by other packages
pull/12615/head
Stuart Carnie 2019-03-13 16:06:26 -07:00
parent 0d045630c8
commit f5c54a00b0
No known key found for this signature in database
GPG Key ID: 848D9C9718D78B4F
1 changed files with 14 additions and 0 deletions

View File

@ -6,3 +6,17 @@ type BuildInfo struct {
Commit string // Commit is the current git commit SHA
Date string // Date is the build date in RFC3339
}
var buildInfo BuildInfo
// SetBuildInfo sets the build information for the binary.
func SetBuildInfo(version, commit, date string) {
buildInfo.Version = version
buildInfo.Commit = commit
buildInfo.Date = date
}
// GetBuildInfo returns the current build information for the binary.
func GetBuildInfo() BuildInfo {
return buildInfo
}