refactor: enhancement of logging, config and metrics

This commit is contained in:
Jonas Kaninda
2024-11-11 08:50:34 +01:00
parent e25bc218b5
commit 11c72e5e17
12 changed files with 97 additions and 65 deletions

View File

@@ -10,26 +10,20 @@ You may get a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
import (
"os"
"fmt"
)
var Version string
const ConfigVersion = "1.0"
func VERSION(def string) string {
build := os.Getenv("VERSION")
if build == "" {
return def
}
return build
}
func FullVersion() string {
ver := Version
if b := VERSION(""); b != "" {
return b
}
return ver
var Version = "development"
var buildTime string
var gitCommit string
func FullVersion() {
fmt.Printf("Goma Gateway version: %s\n", Version)
fmt.Printf("Configuration version: %s\n", ConfigVersion)
fmt.Printf("Build time: %s\n", buildTime)
fmt.Printf("Git commit: %s\n", gitCommit)
}
const MainExample = "Initialize config: config init --output config.yml\n" +