Documentation ¶
Index ¶
- Constants
- Variables
- func DiffEndpoints(curr, next []endpoint.Endpoint, eq, add, del func(i, j int))
- func SortEndpoints(es []endpoint.Endpoint)
- func WithEndpoint(ctx context.Context, endpoint Endpoint) context.Context
- func WithoutLock() crudOption
- type CRUD
- type CRUDExplorerLocker
- type Cluster
- type Endpoint
- type Explorer
- type Locker
- type Pessimizer
Constants ¶
View Source
const (
MaxGetConnTimeout = 10 * time.Second
)
Variables ¶
View Source
var ( // ErrClusterClosed returned when requested on a closed cluster. ErrClusterClosed = errors.New("cluster closed") // ErrClusterEmpty returned when no connections left in cluster. ErrClusterEmpty = errors.New("cluster empty") // ErrUnknownEndpoint returned when no connections left in cluster. ErrUnknownEndpoint = errors.New("unknown endpoint") // ErrNilBalancerElement returned when requested on a nil Balancer element. ErrNilBalancerElement = errors.New("nil balancer element") // ErrUnknownBalancerElement returned when requested on a unknown Balancer element. ErrUnknownBalancerElement = errors.New("unknown balancer element") // ErrUnknownTypeOfBalancerElement returned when requested on a unknown types of Balancer element. ErrUnknownTypeOfBalancerElement = errors.New("unknown types of balancer element") )
Functions ¶
func DiffEndpoints ¶
func SortEndpoints ¶
func WithEndpoint ¶ added in v3.7.0
func WithoutLock ¶ added in v3.11.4
func WithoutLock() crudOption
Types ¶
type CRUD ¶ added in v3.10.0
type CRUD interface { // Insert inserts endpoint to cluster Insert(ctx context.Context, endpoint endpoint.Endpoint, opts ...crudOption) conn.Conn // Update updates endpoint in cluster Update(ctx context.Context, endpoint endpoint.Endpoint, opts ...crudOption) conn.Conn // Remove removes endpoint from cluster Remove(ctx context.Context, endpoint endpoint.Endpoint, opts ...crudOption) conn.Conn // Get gets conn from cluster Get(ctx context.Context, opts ...crudOption) (cc conn.Conn, err error) }
type CRUDExplorerLocker ¶ added in v3.11.4
type Cluster ¶
type Cluster interface { closer.Closer CRUD Pessimizer Explorer Locker conn.PoolGetter }
Click to show internal directories.
Click to hide internal directories.