Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoDatabase = errors.New("no database found with the specified name") ErrDriverNotSupported = errors.New("database driver not supported") )
Global errors
Functions ¶
This section is empty.
Types ¶
type DBAccess ¶
type DBAccess interface {
New(config DBConfig) (*sqlx.DB, error)
Get() (*sqlx.DB, error)
Close() error
CanLock() bool
RandomFuncName() string
}
DBAccess is the common interface for data access definitions
type DBConfig ¶
type DBConfig struct {
DBName string
Driver string
Address string
Username string
Password string
MaxOpenConnections int
MaxIdleConnections int
ConnectionLifetime time.Duration
}
DBConfig holds the configuration required to initialize a data source
type Generic ¶
type Generic struct {
// contains filtered or unexported fields
}
Generic is the generic data access implementation for `DBAccess` interface. Drivers currently supported: - mysql - sqlite3
func (*Generic) Close ¶
Close should be called when the server ends the execution, so connection are gracefully released
func (*Generic) RandomFuncName ¶
RandomFuncName returns the driver's RANDOM name
Click to show internal directories.
Click to hide internal directories.