Пример #1
0
func (m *Mysql) DSN() string {
	username := utils.GetConfig("mysql", "username")
	password := utils.GetConfig("mysql", "password")
	host := utils.GetConfig("mysql", "host")
	port := utils.GetConfig("mysql", "port")
	dbname := utils.GetConfig("mysql", "dbname")

	return fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8", username, password, host, port, dbname)
}
Пример #2
0
func (c *AdminBase) InitParams() {
	adminroot := utils.GetConfig("app", "adminroot")
	c.Assign("adminroot", adminroot)
	c.Assign("token", c.GetToken())
}