package cluster
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/cluster"
Index ¶
- Constants
- Variables
- type Cluster
- func New( ctx context.Context, config config.Config, pool *conn.Pool, endpoints []endpoint.Endpoint, onBadStateCallback balancer.OnBadStateCallback, ) *Cluster
- func (c *Cluster) Allow(ctx context.Context, cc conn.Conn)
- func (c *Cluster) Ban(ctx context.Context, cc conn.Conn, cause error)
- func (c *Cluster) Close(ctx context.Context) (err error)
- func (c *Cluster) Get(ctx context.Context) (cc conn.Conn, err error)
Constants ¶
Variables ¶
var ( // ErrClusterEmpty returned when no connections left in cluster. ErrClusterEmpty = xerrors.Wrap(fmt.Errorf("cluster empty")) )
nolint: gofumpt nolint: nolintlint
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 ¶
Allow connection in underling pool
func (*Cluster) Ban ¶
Ban connection in underling pool
func (*Cluster) Close ¶
func (*Cluster) Get ¶
Get returns next available connection. It returns error on given deadline cancellation or when cluster become closed.
Source Files ¶
- Version
- v3.25.3
- Published
- May 15, 2022
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 1 minute ago –
Tools for package owners.