-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvars.go
More file actions
55 lines (45 loc) · 1.79 KB
/
vars.go
File metadata and controls
55 lines (45 loc) · 1.79 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package figtree
import (
"embed"
"path/filepath"
"strings"
)
//go:embed VERSION
var versionBytes embed.FS
var currentVersion string
func Version() string {
if len(currentVersion) == 0 {
versionBytes, err := versionBytes.ReadFile("VERSION")
if err != nil {
return ""
}
currentVersion = strings.TrimSpace(string(versionBytes))
}
return currentVersion
}
const (
DefaultYAMLFile string = "config.yml" // Default filename for a YAML configuration file
DefaultJSONFile string = "config.json" // Default filename for a JSON configuration file
DefaultINIFile string = "config.ini" // Default filename for a INI configuration file
tString Mutagenesis = "String"
tBool Mutagenesis = "Bool"
tInt Mutagenesis = "Int"
tInt64 Mutagenesis = "Int64"
tFloat64 Mutagenesis = "Float64"
tDuration Mutagenesis = "Duration"
tUnitDuration Mutagenesis = "UnitDuration"
tList Mutagenesis = "List"
tMap Mutagenesis = "Map"
CallbackAfterChange CallbackWhen = "CallbackAfterChange"
CallbackAfterRead CallbackWhen = "CallbackAfterRead"
CallbackAfterVerify CallbackWhen = "CallbackAfterVerify"
CallbackBeforeChange CallbackWhen = "CallbackBeforeChange"
CallbackBeforeRead CallbackWhen = "CallbackBeforeRead"
CallbackBeforeVerify CallbackWhen = "CallbackBeforeVerify"
)
// Mutageneses is the plural form of Mutagenesis and this is a slice of Mutagenesis
var Mutageneses = []Mutagenesis{tString, tBool, tInt, tInt64, tFloat64, tDuration, tUnitDuration, tList, tMap}
// EnvironmentKey stores the preferred ENV that contains the path to your configuration file (.ini, .json or .yaml)
var EnvironmentKey string = "CONFIG_FILE"
// ConfigFilePath stores the path to the configuration file of choice
var ConfigFilePath string = filepath.Join(".", DefaultYAMLFile)