mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Add VersionInfo struct to render in the /info endpoint
This commit is contained in:
parent
9b8cbb05e3
commit
dafda4a977
@ -499,12 +499,7 @@ func GetBookmarks(c *gin.Context) {
|
||||
|
||||
// GetInfo renders the pgweb system information
|
||||
func GetInfo(c *gin.Context) {
|
||||
successResponse(c, gin.H{
|
||||
"version": command.Version,
|
||||
"go_version": command.GoVersion,
|
||||
"git_sha": command.GitCommit,
|
||||
"build_time": command.BuildTime,
|
||||
})
|
||||
successResponse(c, command.Info)
|
||||
}
|
||||
|
||||
// DataExport performs database table export
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user