package config import ( "github.com/BurntSushi/toml" ) var Cfg Config type Config struct { Server server Database database Mail mail RabbitMq rabbitmq Settings settings } type server struct { Debug bool Host string } type database struct { Host string Database string Username string Password string } type mail struct { Host string Key string } type rabbitmq struct { Host string Username string Password string } type settings struct { DefaultLanguageId int Expires settingsExpires `toml:"expires"` Lengths settingsLengths `toml:"lengths"` } type settingsExpires struct { UserSession int UserActions userActions `toml:"userActions"` } type userActions struct { Id_0 int Id_1 int } type settingsLengths struct { UsernameMinLen int UsernameMaxLen int EmailMinLen int EmailMaxLen int PasswordMinLen int PasswordMaxLen int } func LoadConfig() { toml.DecodeFile("./config.toml", &Cfg) }