appidea-mailer/modules/config/config.go

44 lines
575 B
Go

package config
import (
"github.com/BurntSushi/toml"
)
var Cfg Config
type Config struct {
Server server
Mail mail
RabbitMq rabbitmq
Templates templates
}
type server struct {
Debug bool
Host string
}
type mail struct {
Host string
Port string
User string
Password string
From string
TemplatePath string
}
type rabbitmq struct {
Host string
Username string
Password string
}
type templates struct {
FolderPath string
ConfigPath string
}
func LoadConfig() {
toml.DecodeFile("./config.toml", &Cfg)
}