Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DB host
Host string
// DB port
Port int64
// DB user name
Username string
// DB user password
Password string
// DB name
Database string
// DB table name
TableName string
// Maximum wait for connection, in seconds. Zero or
// not specified means wait indefinitely.
Timeout time.Duration
// The maximum number of connections in the idle connection pool.
//
// If MaxOpenConns is greater than 0 but less than the new MaxIdleConns,
// then the new MaxIdleConns will be reduced to match the MaxOpenConns limit.
//
// If n <= 0, no idle connections are retained.
//
// The default max idle connections is currently 2. This may change in
// a future release.
MaxIdleConns int
// The maximum number of open connections to the database.
//
// If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than
// MaxIdleConns, then MaxIdleConns will be reduced to match the new
// MaxOpenConns limit.
//
// If n <= 0, then there is no limit on the number of open connections.
// The default is 0 (unlimited).
MaxOpenConns int
// The maximum amount of time a connection may be reused.
//
// Expired connections may be closed lazily before reuse.
//
// If d <= 0, connections are reused forever.
ConnMaxLifetime time.Duration
}
Config provider settings
func NewConfigWith ¶
func NewConfigWith(host string, port int64, username string, password string, dbName string, tableName string) Config
NewConfigWith returns a new configuration with especific paremters
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig returns a default configuration
Click to show internal directories.
Click to hide internal directories.