1Panel/backend/configs/mysql.go
2022-08-17 09:37:30 +08:00

12 lines
280 B
Go

package configs
import "fmt"
type Mysql struct {
GeneralDB `yaml:",inline" mapstructure:",squash"`
}
func (m *Mysql) Dsn() string {
return fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=true&loc=Asia%%2FShanghai", m.Username, m.Password, m.Path, m.Port, m.Dbname)
}