added settings
parent
2632665845
commit
03adf0c8bb
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue