init.go 408 B

123456789101112131415161718
  1. package models
  2. import (
  3. "github.com/astaxie/beego/orm"
  4. _ "github.com/go-sql-driver/mysql"
  5. )
  6. const (
  7. // Database
  8. connectionString = "benchmarkdbuser:benchmarkdbpass@tcp(tfb-database:3306)/hello_world"
  9. macIdleConnection = 30
  10. maxConnectionCount = 256
  11. )
  12. func init() {
  13. orm.RegisterModel(new(World))
  14. orm.RegisterDataBase("default", "mysql", connectionString, macIdleConnection, maxConnectionCount)
  15. }