-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
67 lines (56 loc) · 1.13 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
package libdctlint
import (
"github.com/rs/zerolog"
)
// Conf holds template checking instructions. The field type FileName must
// be updated each time CheckTemplate() is called to match with the
// bufio.Reader argument.
type Conf struct {
fileName string
tlog zerolog.Logger
collision map[string]bool
checkLogos bool
cloudflare bool
inplace bool
increment bool
prettyPrint bool
ttl uint
}
// NewConf will create template check configuration.
func NewConf() *Conf {
return &Conf{
collision: make(map[string]bool),
}
}
func (c *Conf) SetFilename(fn string) *Conf {
c.fileName = fn
return c
}
func (c *Conf) SetLogger(l zerolog.Logger) *Conf {
c.tlog = l
return c
}
func (c *Conf) SetCheckLogos(b bool) *Conf {
c.checkLogos = b
return c
}
func (c *Conf) SetCloudflare(b bool) *Conf {
c.cloudflare = b
return c
}
func (c *Conf) SetInplace(b bool) *Conf {
c.inplace = b
return c
}
func (c *Conf) SetIncrement(b bool) *Conf {
c.increment = b
return c
}
func (c *Conf) SetPrettyPrint(b bool) *Conf {
c.prettyPrint = b
return c
}
func (c *Conf) SetTTL(t uint) *Conf {
c.ttl = t
return c
}