Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirstReady ¶
FirstReady returns first alive egress node starting from beginning. If no nodes are alive, it returns nil.
func NewFirstReady ¶
func NewFirstReady[PT Egress[T], T any]() *FirstReady[PT, T]
func (*FirstReady[PT, T]) Get ¶
func (fr *FirstReady[PT, T]) Get(egresses []PT) PT
type Random ¶
type Random[PT Egress[T], T any] struct { *FirstReady[PT, T] }
Random returns random egress node if it's alive. If chosen randomly node is not alive, it falls to FirstReady behaviour.
type RoundRobin ¶
RoundRobin returns next alive egress node. It keeps track of previously chosen node index, so it can determine next one.
Node index is guarded by mutex.
func NewRoundRobin ¶
func NewRoundRobin[PT Egress[T], T any]() *RoundRobin[PT, T]
func (*RoundRobin[PT, T]) Get ¶
func (c *RoundRobin[PT, T]) Get(egresses []PT) PT
Click to show internal directories.
Click to hide internal directories.