|
|
|
@ -3,6 +3,7 @@ package config
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
|
|
|
|
"net/url"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -41,8 +42,8 @@ func Init() {
|
|
|
|
RuntimePath,
|
|
|
|
RuntimePath,
|
|
|
|
viper.GetString("log_save_path"))
|
|
|
|
viper.GetString("log_save_path"))
|
|
|
|
MysqlDns = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
|
|
|
MysqlDns = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
|
|
|
viper.GetString("mysql_user"),
|
|
|
|
url.QueryEscape(viper.GetString("mysql_user")),
|
|
|
|
viper.GetString("mysql_passwd"),
|
|
|
|
url.QueryEscape(viper.GetString("mysql_passwd")),
|
|
|
|
fmt.Sprintf(
|
|
|
|
fmt.Sprintf(
|
|
|
|
"%s:%s",
|
|
|
|
"%s:%s",
|
|
|
|
viper.GetString("mysql_host"),
|
|
|
|
viper.GetString("mysql_host"),
|
|
|
|
|