1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 21:10:39 +00:00

rft: Move build info to pkg

This commit is contained in:
Ming Deng
2020-09-08 21:54:35 +08:00
parent 7effdb0e7d
commit bd1cfefec7
7 changed files with 30 additions and 22 deletions

View File

@ -15,12 +15,14 @@
package adapter
import (
"github.com/astaxie/beego/pkg"
"github.com/astaxie/beego/pkg/server/web"
)
const (
// VERSION represent beego web framework version.
VERSION = web.VERSION
VERSION = pkg.VERSION
// DEV is for develop
DEV = web.DEV

View File

@ -23,6 +23,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/astaxie/beego/pkg"
"github.com/astaxie/beego/pkg/infrastructure/logs"
"github.com/astaxie/beego/pkg/server/web"
)
@ -58,13 +59,13 @@ func registerBuildInfo() {
Help: "The building information",
ConstLabels: map[string]string{
"appname": web.BConfig.AppName,
"build_version": web.BuildVersion,
"build_revision": web.BuildGitRevision,
"build_status": web.BuildStatus,
"build_tag": web.BuildTag,
"build_time": strings.Replace(web.BuildTime, "--", " ", 1),
"go_version": web.GoVersion,
"git_branch": web.GitBranch,
"build_version": pkg.BuildVersion,
"build_revision": pkg.BuildGitRevision,
"build_status": pkg.BuildStatus,
"build_tag": pkg.BuildTag,
"build_time": strings.Replace(pkg.BuildTime, "--", " ", 1),
"go_version": pkg.GoVersion,
"git_branch": pkg.GitBranch,
"start_time": time.Now().Format("2006-01-02 15:04:05"),
},
}, []string{})