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, needDiscoveryCallback balancer.OnBadStateCallback, ) *Cluster
- 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)
- func (c *Cluster) Unban(ctx context.Context, cc conn.Conn)
Constants ¶
Variables ¶
var ( // ErrClusterClosed returned when requested on a closed cluster. ErrClusterClosed = xerrors.Wrap(fmt.Errorf("cluster closed")) // ErrClusterEmpty returned when no connections left in cluster. ErrClusterEmpty = xerrors.Wrap(fmt.Errorf("cluster 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, needDiscoveryCallback balancer.OnBadStateCallback, ) *Cluster
func (*Cluster) Ban ¶
Pessimize 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.
func (*Cluster) Unban ¶
Unpessimize connection in underling pool
Source Files ¶
- Version
- v3.24.3-rc0
- Published
- May 4, 2022
- Platform
- darwin/amd64
- Imports
- 12 packages
- Last checked
- 4 minutes ago –
Tools for package owners.