package cluster
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/cluster"
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
- type Cluster
- func New( ctx context.Context, config config.Config, pool conn.Pool, ) *Cluster
- func (c *Cluster) Close(ctx context.Context) (err error)
- func (c *Cluster) Force()
- func (c *Cluster) Get(ctx context.Context) (cc conn.Conn, err error)
- func (c *Cluster) Insert(ctx context.Context, e endpoint.Endpoint, opts ...CrudOption)
- func (c *Cluster) Pessimize(ctx context.Context, cc conn.Conn, cause error)
- func (c *Cluster) Remove(ctx context.Context, e endpoint.Endpoint, opts ...CrudOption)
- func (c *Cluster) SetExplorer(repeater repeater.Repeater)
- type CrudOption
- type Endpoint
- type Explorer
- type Getter
- type Inserter
- type Remover
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")) )
Functions ¶
func DiffEndpoints ¶
func SortEndpoints ¶
func WithEndpoint ¶
Types ¶
type Cluster ¶
func New ¶
func (*Cluster) Close ¶
func (*Cluster) Force ¶
func (c *Cluster) Force()
Force reexpore cluster
func (*Cluster) Get ¶
Get returns next available connection. It returns error on given deadline cancellation or when cluster become closed.
func (*Cluster) Insert ¶
Insert inserts new connection into the cluster.
func (*Cluster) Pessimize ¶
Pessimize connection in underling pool
func (*Cluster) Remove ¶
Remove removes and closes previously inserted connection.
func (*Cluster) SetExplorer ¶
type CrudOption ¶
type CrudOption func(h *crudOptionsHolder)
func WithoutLock ¶
func WithoutLock() CrudOption
type Endpoint ¶
type Endpoint interface { NodeID() uint32 }
func ContextEndpoint ¶
type Explorer ¶
type Getter ¶
type Getter interface { // Get returns next available connection. // It returns error on given deadline cancellation or when cluster become closed. Get(ctx context.Context) (cc conn.Conn, err error) }
type Inserter ¶
type Inserter interface { // Insert inserts endpoint to cluster Insert(ctx context.Context, endpoint endpoint.Endpoint, opts ...CrudOption) }
type Remover ¶
type Remover interface { // Remove removes endpoint from cluster Remove(ctx context.Context, endpoint endpoint.Endpoint, opts ...CrudOption) }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal/cluster/entry |
- Version
- v3.24.2
- Published
- Apr 28, 2022
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 6 minutes ago –
Tools for package owners.