forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
35 lines (31 loc) · 795 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
package smtp
import (
"time"
"github.com/influxdb/influxdb/toml"
)
type Config struct {
Enabled bool `toml:"enabled"`
Host string `toml:"host"`
Port int `toml:"port"`
Username string `toml:"username"`
Password string `toml:"password"`
// Whether to skip TLS verify.
NoVerify bool `toml:"no-verify"`
// Whether all alerts should trigger an email.
Global bool `toml:"global"`
// From address
From string `toml:"from"`
// Default To addresses
To []string `toml:"to"`
// Close connection to SMTP server after idle timeout has elapsed
IdleTimeout toml.Duration `toml:"idle-timeout"`
}
func NewConfig() Config {
return Config{
Host: "localhost",
Port: 25,
Username: "",
Password: "",
IdleTimeout: toml.Duration(time.Second * 30),
}
}