Add VersionInfo struct to render in the /info endpoint

This commit is contained in:
Dan Sosedoff
2022-12-01 16:41:46 -06:00
parent 9b8cbb05e3
commit dafda4a977
2 changed files with 18 additions and 6 deletions

View File

@@ -14,4 +14,21 @@ var (
// GoVersion contains the build time Go version
GoVersion string
// Info contains all version information
Info VersionInfo
)
type VersionInfo struct {
Version string `json:"version"`
GitCommit string `json:"git_sha"`
BuildTime string `json:"build_time"`
GoVersion string `json:"go_version"`
}
func init() {
Info.Version = Version
Info.GitCommit = GitCommit
Info.BuildTime = BuildTime
Info.GoVersion = GoVersion
}