Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Balancer ¶
type Balancer interface { // Next returns next connection for request. Next(ctx context.Context, opts ...NextOption) conn.Conn // Create same balancer instance with new connections Create(conns []conn.Conn) Balancer }
Balancer is an interface that implements particular load-balancing algorithm.
Balancer methods called synchronized. That is, implementations must not provide additional goroutine safety.
type NextOption ¶ added in v3.25.0
type NextOption func(o *NextOptions)
func WithAcceptBanned ¶ added in v3.25.0
func WithAcceptBanned(val bool) NextOption
func WithOnBadState ¶ added in v3.25.0
func WithOnBadState(callback OnBadStateCallback) NextOption
type NextOptions ¶ added in v3.25.0
type NextOptions struct { OnBadState OnBadStateCallback AcceptBanned bool }
func MakeNextOptions ¶ added in v3.25.0
func MakeNextOptions(opts ...NextOption) NextOptions
func (*NextOptions) Discovery ¶ added in v3.25.0
func (o *NextOptions) Discovery(ctx context.Context)
type OnBadStateCallback ¶ added in v3.25.0
Click to show internal directories.
Click to hide internal directories.