Documentation ¶
Index ¶
- func New(engine Engine, options DatabaseConnectionOpts) (*goqu.Database, error)
- func NewMySQLHandler(options DatabaseConnectionOpts) (*sql.DB, error)
- func NewPostgresHandler(options DatabaseConnectionOpts) (*sql.DB, error)
- type DatabaseChecker
- type DatabaseConnectionOpts
- type Engine
- type MySQLConnectionOpts
- type PostgresConnOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(engine Engine, options DatabaseConnectionOpts) (*goqu.Database, error)
New initiates and returns a goqu database
func NewMySQLHandler ¶
func NewMySQLHandler(options DatabaseConnectionOpts) (*sql.DB, error)
NewMySQLHandler instantiates a MySQLHandler struct an return its pointer
func NewPostgresHandler ¶
func NewPostgresHandler(options DatabaseConnectionOpts) (*sql.DB, error)
NewPostgresHandler instantiates a PostgresHandler struct an return its pointer
Types ¶
type DatabaseChecker ¶
type DatabaseChecker struct {
// contains filtered or unexported fields
}
DatabaseChecker simple database checker for application
func (*DatabaseChecker) Diagnose ¶
func (d *DatabaseChecker) Diagnose() diagnose.ComponentReport
Diagnose start diagnose check http://confluence.alaudatech.com/pages/viewpage.action?pageId=14123161
type DatabaseConnectionOpts ¶
type DatabaseConnectionOpts struct { Host string Database string User string Password string Port string Timeout int MaxConnections int MaxIdleConnections int ConnMaxLifetime int Params map[string]string }
DatabaseConnectionOpts common connection options
func NewDatabaseConnectionOpts ¶
func NewDatabaseConnectionOpts(host, database, user, password, port string, timeout, maxConn, maxIdleConn, connMaxLifetime int) *DatabaseConnectionOpts
NewDatabaseConnectionOpts constructor function for DatabaseConnectionOpts
func (*DatabaseConnectionOpts) GetConnString ¶
func (opts *DatabaseConnectionOpts) GetConnString() string
GetConnString returns a standard connection string
func (*DatabaseConnectionOpts) GetParams ¶
func (opts *DatabaseConnectionOpts) GetParams() string
GetParams returns all the parameters with their values to be used in a connection string
type MySQLConnectionOpts ¶
type MySQLConnectionOpts struct { DatabaseConnectionOpts Protocol string }
MySQLConnectionOpts connection options for MySQL
func NewMySQLConnOptions ¶
func NewMySQLConnOptions( dbConnOpts DatabaseConnectionOpts, ) *MySQLConnectionOpts
NewMySQLConnOptions constructor function for mysql specific connection options
func (*MySQLConnectionOpts) GetConnString ¶
func (opts *MySQLConnectionOpts) GetConnString() string
GetConnString returns a connection string used to connect to a mysql database
type PostgresConnOptions ¶
type PostgresConnOptions struct { DatabaseConnectionOpts SSLEnabled bool }
PostgresConnOptions give optional configuration options for db connecton
func NewPostgresConnOptions ¶
func NewPostgresConnOptions( dbConnectionOpts DatabaseConnectionOpts, ) *PostgresConnOptions
NewPostgresConnOptions constructor function for postgres specific connection options
func (*PostgresConnOptions) GetConnString ¶
func (opts *PostgresConnOptions) GetConnString() string
GetConnString returns connection string postgres database