-
Notifications
You must be signed in to change notification settings - Fork 4
/
vars.go
47 lines (38 loc) · 869 Bytes
/
vars.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
37
38
39
40
41
42
43
44
45
46
47
package config
import (
"errors"
"time"
)
const (
defaultFormat = "stylish"
defaultTimeout = 30 * time.Second
configDirPerm = 0o700
configFilePerm = 0o600
)
var (
MainManager = NewManager()
Formats = []string{
"stylish",
"json",
"yaml",
}
FormatDescriptions = []string{
"stylish\tOutput format for human consumption",
"json\tOutput in JSON",
"yaml\tOutput in YAML",
}
ErrConfigExists = errors.New("configFile already exists")
ErrUnknownProfile = errors.New("profile not found")
ErrDuplicateProfile = errors.New("profile already exists")
ErrConfigLoad = errors.New("unable to load config")
ErrInvalidValue = errors.New("invalid value")
)
func GetConfig() *Config {
return MainManager.config
}
func GetOptions() *Options {
return MainManager.options
}
func GetSettings() *Settings {
return MainManager.settings
}