fix: timezone parse time issue
This commit is contained in:
@@ -11,6 +11,17 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type DbConfig struct {
|
||||
Type string `yaml:"type"`
|
||||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
Host string `yaml:"host"`
|
||||
Port string `yaml:"port"`
|
||||
Name string `yaml:"name"`
|
||||
ConnParam string `yaml:"connParam,omitempty"`
|
||||
Backup string `yaml:"backup"`
|
||||
}
|
||||
|
||||
// Yaml struct of config
|
||||
type YamlConfig struct {
|
||||
Logger struct {
|
||||
@@ -24,17 +35,20 @@ type YamlConfig struct {
|
||||
Addr string `yaml:"addr"`
|
||||
} `yaml:"gtp"`
|
||||
|
||||
Database struct {
|
||||
Type string `yaml:"type"`
|
||||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
Host string `yaml:"host"`
|
||||
Port string `yaml:"port"`
|
||||
Name string `yaml:"name"`
|
||||
} `yaml:"database"`
|
||||
Database DbConfig `yaml:"database"`
|
||||
}
|
||||
|
||||
var YamlConf YamlConfig
|
||||
var YamlConf YamlConfig = NewYamlConfig()
|
||||
|
||||
// set default value for yaml config
|
||||
func NewYamlConfig() YamlConfig {
|
||||
return YamlConfig{
|
||||
Database: DbConfig{
|
||||
Type: "mysql",
|
||||
ConnParam: "charset=utf8mb4&collation=utf8mb4_general_ci&loc=Local",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func ReadConfig(configFile string) {
|
||||
yamlFile, err := os.ReadFile(configFile)
|
||||
|
||||
Reference in New Issue
Block a user