Documentation ¶
Index ¶
Constants ¶
View Source
const ( SelectorNameUnknown = "unknown" SelectorNameRandom = "random" )
View Source
const RestoreSetVariableFlags = format.RestoreStringSingleQuotes
View Source
const (
SelectorTypeRandom = 1 + iota
)
Variables ¶
View Source
var ( ErrNoBackendAddr = errors.New("no backend addr") ErrBackendClosed = errors.New("backend is closed") ErrBackendNotFound = errors.New("backend not found") )
View Source
var ( ErrNoInstanceToSelect = errors.New("no instance to select") ErrInvalidSelectorType = errors.New("invalid selector type") )
Functions ¶
func SelectorNameToType ¶
func SelectorTypeToName ¶
Types ¶
type BackendConfig ¶
type BackendImpl ¶
type BackendImpl struct {
// contains filtered or unexported fields
}
func NewBackendImpl ¶
func NewBackendImpl(ns string, cfg *BackendConfig) *BackendImpl
func (*BackendImpl) Close ¶
func (b *BackendImpl) Close()
func (*BackendImpl) GetConn ¶
func (b *BackendImpl) GetConn(ctx context.Context) (driver.SimpleBackendConn, error)
func (*BackendImpl) GetPooledConn ¶
func (b *BackendImpl) GetPooledConn(ctx context.Context) (driver.PooledBackendConn, error)
func (*BackendImpl) Init ¶
func (b *BackendImpl) Init() error
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
func NewConnPool ¶
func NewConnPool(ns string, cfg *ConnPoolConfig) *ConnPool
type RandomSelector ¶
type RandomSelector struct {
// contains filtered or unexported fields
}
func NewRandomSelector ¶
func NewRandomSelector(rd *rand2.Rand) *RandomSelector
Click to show internal directories.
Click to hide internal directories.