/
version.go
36 lines (30 loc) · 952 Bytes
/
version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fmt"
"os"
"path"
)
const (
Major = 0
Minor = 1
PackVer = 0
Usage = "distributed api gateway"
UsageText = "dolphin [-c|--config value] [--pprof value] [--loglvl value] [-p|--period value]"
ConfigUsage = "Path to config file. if empty, will finding in ${HOME}/.config/dolphin.d/config.toml and /etc/dolphin.d/config.toml"
PprofUsage = "File name to save profiling info to. Disabled if not set."
LoglvlUsage = "debug,info,warn"
PeriodUsage = "The pprof time span"
FlagConfigKey = "config"
FlagPprofKey = "pprof"
FlagLoglvlKey = "loglvl"
FlagPeriodKey = "period"
)
/// go build -ldflags "-X main.VERSION=`date -u +.%Y%m%d.%H%M%S`" main.go
var (
STAGE = "dev"
VERSION string
GITCOMMIT string
DisplayVersion = fmt.Sprintf("%d.%d.%d", Major, Minor, PackVer)
DisplayName = path.Base(os.Args[0])
DescriptionText = fmt.Sprintf("internal version: %s-%s-%s", STAGE, VERSION, GITCOMMIT)
)