Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DbSetting ¶
type DbSetting struct { Common *Common `yaml:"common"` MySql *MySqlSetting `yaml:"mysql"` Postgres *PostgresSetting `yaml:"postgres"` SqlServer *SqlServerSetting `yaml:"sqlServer"` }
var DbSet DbSetting
type MySqlConnection ¶
type MySqlPool ¶
type MySqlPool struct {
// contains filtered or unexported fields
}
var ( MySqlDsnFormat = "%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=True&loc=Local" MysqlPoolApp MySqlPool )
type MySqlSetting ¶
type MySqlSetting struct { MaxOpenConns int `yaml:"maxOpenConns"` MaxIdleConns int `yaml:"maxIdleConns"` MaxLifetime int `yaml:"maxLifetime"` MaxIdleTime int `yaml:"maxIdleTime"` Rws bool `yaml:"rws"` Main *MySqlConnection `yaml:"main"` Sources map[string]*MySqlConnection `yaml:"sources"` Replicas map[string]*MySqlConnection `yaml:"replicas"` }
type PostgresConnection ¶
type PostgresPool ¶
type PostgresPool struct {
// contains filtered or unexported fields
}
var ( PostgresDsnFormat = "host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s" PostgresPoolApp PostgresPool )
func (PostgresPool) New ¶
func (PostgresPool) New(dbSetting *DbSetting) *PostgresPool
New 实例化:postgres链接池
type PostgresSetting ¶
type PostgresSetting struct { MaxOpenConnections int `yaml:"maxOpenConns"` MaxIdleConnections int `yaml:"maxIdleConns"` MaxLifetime int `yaml:"maxLifetime"` MaxIdleTime int `yaml:"maxIdleTime"` Main *PostgresConnection `yaml:"main"` }
type SqlServerConnection ¶
type SqlServerPool ¶
type SqlServerPool struct {
// contains filtered or unexported fields
}
var ( SqlServerDsnFormat = "sqlserver://%s:%s@%s:?%d?database=%s" SqlServerPoolApp SqlServerPool )
func (SqlServerPool) New ¶
func (SqlServerPool) New(dbSetting *DbSetting) *SqlServerPool
New 实例化:sql server连接池
type SqlServerSetting ¶
type SqlServerSetting struct { MaxOpenConnections int `yaml:"maxOpenConns"` MaxIdleConnections int `yaml:"maxIdleConns"` MaxLifetime int `yaml:"maxLifetime"` MaxIdleTime int `yaml:"maxIdleTime"` Main *SqlServerConnection `yaml:"main"` }
Click to show internal directories.
Click to hide internal directories.