Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Type string `json:"type" validate:"nonzero"` User string `json:"user" validate:"nonzero"` Password string `json:"password"` Host string `json:"host" validate:"nonzero"` Port uint16 `json:"port" validate:"nonzero"` Timeout int `json:"timeout" validate:"min=1"` DatabaseName string `json:"database_name" validate:""` RequireSSL bool `json:"require_ssl" validate:""` CACert string `json:"ca_cert" validate:""` SkipHostnameValidation bool `json:"skip_hostname_validation" validate:""` }
func (Config) ConnectionString ¶
type ConnWrapper ¶
func GetConnectionPool ¶
func GetConnectionPool(dbConfig Config, ctx context.Context) (*ConnWrapper, error)
func NewConnectionPool ¶
func (*ConnWrapper) Beginx ¶
func (c *ConnWrapper) Beginx() (Transaction, error)
func (*ConnWrapper) OpenConnections ¶
func (c *ConnWrapper) OpenConnections() int
func (*ConnWrapper) Query ¶
func (c *ConnWrapper) Query(query string, args ...interface{}) (*sql.Rows, error)
func (*ConnWrapper) QueryRow ¶
func (c *ConnWrapper) QueryRow(query string, args ...interface{}) *sql.Row
func (*ConnWrapper) RawConnection ¶
func (c *ConnWrapper) RawConnection() *sqlx.DB
type MySQLAdapter ¶
type MySQLAdapter struct{}
func (MySQLAdapter) ParseDSN ¶
func (m MySQLAdapter) ParseDSN(dsn string) (cfg *mysql.Config, err error)
func (MySQLAdapter) RegisterTLSConfig ¶
func (m MySQLAdapter) RegisterTLSConfig(key string, config *tls.Config) error
type MySQLConnectionStringBuilder ¶
type MySQLConnectionStringBuilder struct {
MySQLAdapter mySQLAdapter
}
type RetriableConnector ¶
type RetriableConnector struct { Logger lager.Logger Connector func(Config, context.Context) (*ConnWrapper, error) Sleeper sleeper RetryInterval time.Duration MaxRetries int }
func (*RetriableConnector) GetConnectionPool ¶
func (r *RetriableConnector) GetConnectionPool(dbConfig Config, ctx context.Context) (*ConnWrapper, error)
type RetriableError ¶
func (RetriableError) Error ¶
func (r RetriableError) Error() string
type RowScanner ¶
type RowScanner interface {
Scan(dest ...interface{}) error
}
func NewRowScanner ¶
func NewRowScanner(monitor monitor.Monitor, scanner RowScanner) RowScanner
type SleeperFunc ¶
func (SleeperFunc) Sleep ¶
func (sf SleeperFunc) Sleep(duration time.Duration)
type Transaction ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.