Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPeerFilter ¶
func WithPeerFilter(value PeerFilter) copts.Opt
WithPeerFilter sets a peer filter which provides per-request filtering of peers
func WithPeerSorter ¶
func WithPeerSorter(value PeerSorter) copts.Opt
WithPeerSorter sets a peer sorter function which provides per-request sorting of peers
func WithPrioritySelector ¶
func WithPrioritySelector(value PrioritySelector) copts.Opt
WithPrioritySelector sets a priority selector function which provides per-request prioritization of peers
Types ¶
type Params ¶
type Params struct { PeerFilter PeerFilter PeerSorter PeerSorter RetryOpts retry.Opts }
Params defines the parameters of a selection service request
func (*Params) SetPeerFilter ¶
func (p *Params) SetPeerFilter(value PeerFilter)
SetPeerFilter sets the peer filter
func (*Params) SetPeerSorter ¶
func (p *Params) SetPeerSorter(value PeerSorter)
SetPeerSorter sets the priority selector
func (*Params) SetRetryOpts ¶
SetRetryOpts sets the priority selector
type PrioritySelector ¶
PrioritySelector determines how likely a peer is to be selected over another peer. A positive return value means peer1 is selected; negative return value means the peer2 is selected; zero return value means their priorities are the same