added settings

master
Alex 2021-06-11 14:37:59 +02:00
parent 2632665845
commit 03adf0c8bb
1 changed files with 23 additions and 3 deletions

View File

@ -5,11 +5,13 @@ import (
_ "github.com/go-sql-driver/mysql"
)
var conf Config
var Cfg Config
type Config struct {
Server server
Database database
Mail mail
Settings settings
}
type server struct {
@ -24,10 +26,28 @@ type database struct {
Password string
}
type mail struct {
Host string
Port string
User string
Password string
From string
}
type settings struct {
ExpiredTime int
UsernameMinLen int
UsernameMaxLen int
EmailMinLen int
EmailMaxLen int
PasswordMinLen int
PasswordMaxLen int
}
func LoadConfig() {
toml.DecodeFile("./config.toml", &conf)
toml.DecodeFile("./config.toml", &Cfg)
}
func GetConfig() Config {
return conf
return Cfg
}