Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbSetting ¶
type DbSetting struct {
Common *Common `yaml:"common"`
MySql *MySqlSetting `yaml:"mysql"`
Postgres *PostgresSetting `yaml:"postgres"`
SqlServer *SqlServerSetting `yaml:"sqlServer"`
}
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 {
MaxOpenConns int `yaml:"maxOpenConns"`
MaxIdleConns 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连接池
Source Files
¶
- db.set.go
- mysql_pool.go
- postgres_pool.go
- sqlServer_pool.go
Click to show internal directories.
Click to hide internal directories.