package cluster

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/driver/cluster"

Index

Constants

const (
	MaxGetConnTimeout = 10 * time.Second
)

Variables

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")
)

Functions

func DiffEndpoints

func DiffEndpoints(curr, next []endpoint.Endpoint, eq, add, del func(i, j int))

func SortEndpoints

func SortEndpoints(es []endpoint.Endpoint)

func WithConnConfig

func WithConnConfig(connConfig conn.Config) option

func WithWG

func WithWG(wg wg.WG) option

Types

type Cluster

type Cluster interface {
	Insert(ctx context.Context, endpoint endpoint.Endpoint, opts ...option)
	Update(ctx context.Context, endpoint endpoint.Endpoint, opts ...option)
	Get(ctx context.Context) (conn conn.Conn, err error)
	Pessimize(ctx context.Context, endpoint endpoint.Endpoint) error
	Close(ctx context.Context) error
	Remove(ctx context.Context, endpoint endpoint.Endpoint, wg ...option)
	SetExplorer(repeater repeater.Repeater)
	Force()
}

func New

func New(
	trace trace.Driver,
	dial func(context.Context, string) (*grpc.ClientConn, error),
	balancer balancer.Balancer,
) Cluster

Source Files

cluster.go

Directories

PathSynopsis
internal/driver/cluster/balancer
internal/driver/cluster/balancer/conn
internal/driver/cluster/balancer/conn/endpoint
internal/driver/cluster/balancer/conn/entry
internal/driver/cluster/balancer/conn/info
internal/driver/cluster/balancer/conn/list
internal/driver/cluster/balancer/conn/stub
internal/driver/cluster/balancer/state
internal/driver/cluster/repeater
Version
v3.4.0
Published
Nov 11, 2021
Platform
darwin/amd64
Imports
18 packages
Last checked
32 minutes ago

Tools for package owners.