Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Config object
- type SpamlerConfig struct {
- SecureURL string // SecureURL to listen
- NonSecureURL string // Non secure URL to listen for redirection, can be ommited
- SMTP string // SMTP server
- Port int // Port of SMTP server
- SkipInsecureTLS bool // Skip insecure TLS certificate on SMTP server
- }
- // Load file
- file, err := ioutil.ReadFile(filePath)
- if err != nil {
- log.Fatal(err)
- }
- // Parse file
- var configData SpamlerConfig
- if _, err := toml.Decode(string(file), &configData); err != nil {
- log.Fatal(err)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement