cluster

package
v3.25.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxGetConnTimeout = 10 * time.Second
)

Variables

View Source
var (
	// ErrClusterEmpty returned when no connections left in cluster.
	ErrClusterEmpty = xerrors.Wrap(fmt.Errorf("cluster empty"))
)

nolint: gofumpt nolint: nolintlint

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func New

func New(
	ctx context.Context,
	config config.Config,
	pool *conn.Pool,
	endpoints []endpoint.Endpoint,
	onBadStateCallback balancer.OnBadStateCallback,
) *Cluster

func (*Cluster) Allow added in v3.25.1

func (c *Cluster) Allow(ctx context.Context, cc conn.Conn)

Allow connection in underling pool

func (*Cluster) Ban added in v3.25.0

func (c *Cluster) Ban(ctx context.Context, cc conn.Conn, cause error)

Ban connection in underling pool

func (*Cluster) Close

func (c *Cluster) Close(ctx context.Context) (err error)

func (*Cluster) Get

func (c *Cluster) Get(ctx context.Context) (cc conn.Conn, err error)

Get returns next available connection. It returns error on given deadline cancellation or when cluster become closed.

Jump to

Keyboard shortcuts

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