Example #1
0
File: mysql.go Project: rainkid/ago
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)
}
Example #2
0
File: base.go Project: rainkid/ago
func (c *AdminBase) InitParams() {
	adminroot := utils.GetConfig("app", "adminroot")
	c.Assign("adminroot", adminroot)
	c.Assign("token", c.GetToken())
}