Documentation ¶
Index ¶
- Variables
- func AnyMatch(peerPool []discovery.NetworkMember, filters ...RoutingFilter) []discovery.NetworkMember
- func First(peerPool []discovery.NetworkMember, filter RoutingFilter) *comm.RemotePeer
- func SelectPeers(k int, peerPool []discovery.NetworkMember, filter RoutingFilter) []*comm.RemotePeer
- type RoutingFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var SelectAllPolicy = func(discovery.NetworkMember) bool { return true }
selectallpolicy选择给定的所有成员
View Source
var SelectNonePolicy = func(discovery.NetworkMember) bool { return false }
SelectNonePolicy selects an empty set of members
Functions ¶
func AnyMatch ¶
func AnyMatch(peerPool []discovery.NetworkMember, filters ...RoutingFilter) []discovery.NetworkMember
any match筛选出与任何给定筛选器都不匹配的对等方
func First ¶
func First(peerPool []discovery.NetworkMember, filter RoutingFilter) *comm.RemotePeer
first返回与给定筛选器匹配的第一个对等机
func SelectPeers ¶
func SelectPeers(k int, peerPool []discovery.NetworkMember, filter RoutingFilter) []*comm.RemotePeer
selectpeers返回一个与路由筛选器匹配的对等片
Types ¶
type RoutingFilter ¶
type RoutingFilter func(discovery.NetworkMember) bool
routingfilter定义网络成员上的谓词 它用于断言给定的networkmember是否应 为获得消息而选择
func CombineRoutingFilters ¶
func CombineRoutingFilters(filters ...RoutingFilter) RoutingFilter
combineroutingfilters返回给定路由筛选器的逻辑与
Click to show internal directories.
Click to hide internal directories.