package balancers
import "github.com/ydb-platform/ydb-go-sdk/v3/balancers"
Index ¶
- func CreateFromConfig(config string) (balancer.Balancer, error)
- func Default() balancer.Balancer
- func FromConfig(config string, opts ...fromConfigOption) balancer.Balancer
- func Prefer(balancer balancer.Balancer, filter func(endpoint Endpoint) bool) balancer.Balancer
- func PreferLocalDC(balancer balancer.Balancer) balancer.Balancer
- func PreferLocalDCWithFallBack(balancer balancer.Balancer) balancer.Balancer
- func PreferLocations(balancer balancer.Balancer, locations ...string) balancer.Balancer
- func PreferLocationsWithFallback(balancer balancer.Balancer, locations ...string) balancer.Balancer
- func PreferWithFallback(balancer balancer.Balancer, filter func(endpoint Endpoint) bool) balancer.Balancer
- func RandomChoice() balancer.Balancer
- func RoundRobin() balancer.Balancer
- func SingleConn() balancer.Balancer
- func WithParseErrorFallbackBalancer(b balancer.Balancer) fromConfigOption
- func WithParseErrorHandler(errorHandler func(error)) fromConfigOption
- type Endpoint
Functions ¶
func CreateFromConfig ¶
func Default ¶
func FromConfig ¶
func Prefer ¶
Prefer creates balancer which use endpoints by filter Balancer "balancer" defines balancing algorithm between endpoints selected with filter
func PreferLocalDC ¶
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 ¶
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 ¶
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 ¶
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 RoundRobin ¶
func SingleConn ¶
func WithParseErrorFallbackBalancer ¶
func WithParseErrorHandler ¶
func WithParseErrorHandler(errorHandler func(error)) fromConfigOption
Types ¶
type Endpoint ¶
Source Files ¶
- Version
- v3.14.2
- Published
- Mar 12, 2022
- Platform
- darwin/amd64
- Imports
- 8 packages
- Last checked
- 13 seconds ago –
Tools for package owners.