mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
802 B
43 lines
802 B
// Copyright 2022 ROC. All rights reserved.
|
|
// Use of this source code is governed by a MIT style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package version
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
const (
|
|
series = "v0.6-dev"
|
|
)
|
|
|
|
var (
|
|
version = "unknown"
|
|
commitID = "unknown"
|
|
buildDate = "unknown"
|
|
buildTags = "unknown"
|
|
)
|
|
|
|
type BuildInfo struct {
|
|
Series string `json:"series"`
|
|
Version string `json:"version"`
|
|
Sum string `json:"sum"`
|
|
BuildDate string `json:"build_date"`
|
|
BuildTags string `json:"build_tags"`
|
|
}
|
|
|
|
func VersionInfo() string {
|
|
return fmt.Sprintf("paopao %s (build:%s %s)", version, commitID, buildDate)
|
|
}
|
|
|
|
func ReadBuildInfo() *BuildInfo {
|
|
return &BuildInfo{
|
|
Series: series,
|
|
Version: version,
|
|
Sum: commitID,
|
|
BuildDate: buildDate,
|
|
BuildTags: buildTags,
|
|
}
|
|
}
|