package balancers

import "github.com/ydb-platform/ydb-go-sdk/v3/balancers"

Index

Functions

func Default

func Default() balancer.Balancer

func Prefer

func Prefer(balancer balancer.Balancer, filter func(endpoint Endpoint) bool) balancer.Balancer

Prefer creates balancer which use endpoints by filter Balancer "balancer" defines balancing algorithm between endpoints selected with filter

func PreferLocalDC

func PreferLocalDC(balancer balancer.Balancer) balancer.Balancer

PreferLocalDC creates balancer which use endpoints only in location such as initial endpoint location Balancer "balancer" defines balancing algorithm between endpoints selected with filter by location

func PreferLocalDCWithFallBack

func PreferLocalDCWithFallBack(balancer balancer.Balancer) balancer.Balancer

PreferLocalDCWithFallBack creates balancer which use endpoints only in location such as initial endpoint location Balancer "balancer" defines balancing algorithm between endpoints selected with filter by location If filter returned zero endpoints from all discovery endpoints list - used all endpoint instead

func PreferLocations

func PreferLocations(balancer balancer.Balancer, locations ...string) balancer.Balancer

PreferLocations creates balancer which use endpoints only in selected locations (such as "ABC", "DEF", etc.) Balancer "balancer" defines balancing algorithm between endpoints selected with filter by location

func PreferLocationsWithFallback

func PreferLocationsWithFallback(balancer balancer.Balancer, locations ...string) balancer.Balancer

PreferLocationsWithFallback creates balancer which use endpoints only in selected locations Balancer "balancer" defines balancing algorithm between endpoints selected with filter by location If filter returned zero endpoints from all discovery endpoints list - used all endpoint instead

func PreferWithFallback

func PreferWithFallback(balancer balancer.Balancer, filter func(endpoint Endpoint) bool) balancer.Balancer

PreferWithFallback creates balancer which use endpoints by filter Balancer "balancer" defines balancing algorithm between endpoints selected with filter If filter returned zero endpoints from all discovery endpoints list - used all endpoint instead

func RandomChoice

func RandomChoice() balancer.Balancer

func RoundRobin

func RoundRobin() balancer.Balancer

func SingleConn

func SingleConn() balancer.Balancer

Types

type Endpoint

type Endpoint interface {
	NodeID() uint32
	Address() string
	Location() string
	LocalDC() bool
}

Source Files

balancer.go

Version
v3.13.0-rc3
Published
Mar 9, 2022
Platform
js/wasm
Imports
6 packages
Last checked
18 minutes ago

Tools for package owners.