Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSqlite3 ¶ added in v0.4.0
Types ¶
type Config ¶
type Config struct {
// EnableLog enabled log flag use by user
EnableLog bool `yaml:"enableLog" json:"enableLog"`
// mysql sqlite3 postgres
Dialect string `yaml:"dialect" json:"dialect"`
Source SourceServe `yaml:"source" json:"source"`
Replica ReplicaServe `yaml:"replica" json:"replica"`
}
type Node ¶ added in v0.4.0
type Node struct {
// dsn
Dsn string `yaml:"dsn" json:"dsn"`
}
Node 数据库配置
type ReplicaServe ¶ added in v0.4.0
type ReplicaServe struct {
// MaxIdleConn sets the maximum number of open connections to the database.
// If n <= 0, then there is no limit on the number of open connections.
// The default is 0 (unlimited).
MaxIdleConn int `yaml:"maxIdleConn" json:"maxIdleConn"`
// MaxOpenConn sets the maximum number of open connections to the database.
// If n <= 0, then there is no limit on the number of open connections.
// The default is 0 (unlimited).
MaxOpenConn int `yaml:"maxOpenConn" json:"maxOpenConn"`
// MaxLifetime sets the maximum amount of time a connection may be reused.
// If d <= 0, connections are not closed due to a connection's age.
MaxLifetime time.Duration `yaml:"maxLifetime" json:"maxLifetime"`
// MaxIdleTime sets the maximum amount of time a connection may be idle.
// If d <= 0, connections are not closed due to a connection's idle time.
MaxIdleTime time.Duration `yaml:"maxIdleTime" json:"maxIdleTime"`
Node []Node `yaml:"node" json:"node"`
}
type SourceServe ¶ added in v0.4.0
type SourceServe struct {
// MaxIdleConn sets the maximum number of open connections to the database.
// If n <= 0, then there is no limit on the number of open connections.
// The default is 0 (unlimited).
MaxIdleConn int `yaml:"maxIdleConn" json:"maxIdleConn"`
// MaxOpenConn sets the maximum number of open connections to the database.
// If n <= 0, then there is no limit on the number of open connections.
// The default is 0 (unlimited).
MaxOpenConn int `yaml:"maxOpenConn" json:"maxOpenConn"`
// MaxLifetime sets the maximum amount of time a connection may be reused.
// If d <= 0, connections are not closed due to a connection's age.
MaxLifetime time.Duration `yaml:"maxLifetime" json:"maxLifetime"`
// MaxIdleTime sets the maximum amount of time a connection may be idle.
// If d <= 0, connections are not closed due to a connection's idle time.
MaxIdleTime time.Duration `yaml:"maxIdleTime" json:"maxIdleTime"`
Node Node `yaml:"node" json:"node"`
}
Click to show internal directories.
Click to hide internal directories.