appidea-restapi/modules/config/config.go

34 lines
420 B
Go

package config
import (
"github.com/BurntSushi/toml"
_ "github.com/go-sql-driver/mysql"
)
var conf Config
type Config struct {
Server server
Database database
}
type server struct {
Debug bool
Host string
}
type database struct {
Host string
Database string
Username string
Password string
}
func LoadConfig() {
toml.DecodeFile("./config.toml", &conf)
}
func GetConfig() Config {
return conf
}