db

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnectionPool

func GetConnectionPool(dbConfig Config) (*sqlx.DB, error)

Types

type Config

type Config struct {
	Type     string `json:"type"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	Name     string `json:"name"`
	SSLMode  string `json:"ssl_mode"`
}

type RetriableConnector

type RetriableConnector struct {
	Connector     func(Config) (*sqlx.DB, error)
	Sleeper       sleeper
	RetryInterval time.Duration
	MaxRetries    int
}

func (*RetriableConnector) GetConnectionPool

func (r *RetriableConnector) GetConnectionPool(dbConfig Config) (*sqlx.DB, error)

type RetriableError

type RetriableError struct {
	Inner error
	Msg   string
}

func (RetriableError) Error

func (r RetriableError) Error() string

type SleeperFunc

type SleeperFunc func(time.Duration)

func (SleeperFunc) Sleep

func (sf SleeperFunc) Sleep(duration time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL