-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.go
56 lines (44 loc) · 1009 Bytes
/
config.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
48
49
50
51
52
53
54
55
56
package main
type Config struct {
entries map[string]string
}
func NewConfig() *Config {
return &Config{entries: make(map[string]string, 10)}
}
func (c *Config) SetMountPoint(dir string) {
c.entries["mount"] = dir
}
func (c *Config) GetMountPoint() string {
return c.entries["mount"]
}
func (c *Config) SetShadowDir(dir string) {
c.entries["shadow"] = dir
}
func (c *Config) GetShadowDir() string {
return c.entries["shadow"]
}
func (c *Config) SetOutputFormat(format string) {
c.entries["format"] = format
}
func (c *Config) GetOutputFormat() string {
return c.entries["format"]
}
func (c *Config) SetTraceDestination(fileName string) {
c.entries["destination"] = fileName
}
func (c *Config) GetTraceDestination() string {
return c.entries["destination"]
}
func (c *Config) SetReadOnly(readonly bool) {
s := "false"
if readonly {
s = "true"
}
c.entries["readonly"] = s
}
func (c *Config) GetReadOnly() bool {
if c.entries["readonly"] == "true" {
return true
}
return false
}