-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoption.go
51 lines (42 loc) · 914 Bytes
/
option.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
package eetcd
type Option func(c *Container)
func WithAddrs(addrs []string) Option {
return func(c *Container) {
c.config.Addrs = addrs
}
}
func WithCertFile(certFile string) Option {
return func(c *Container) {
c.config.CertFile = certFile
}
}
func WithKeyFile(keyFile string) Option {
return func(c *Container) {
c.config.KeyFile = keyFile
}
}
func WithCaCert(caCert string) Option {
return func(c *Container) {
c.config.CaCert = caCert
}
}
func WithEnableBasicAuth(enable bool) Option {
return func(c *Container) {
c.config.EnableBasicAuth = enable
}
}
func WithUserName(userName string) Option {
return func(c *Container) {
c.config.UserName = userName
}
}
func WithPassword(password string) Option {
return func(c *Container) {
c.config.Password = password
}
}
func WithEnableSecure(secure bool) Option {
return func(c *Container) {
c.config.EnableSecure = secure
}
}