Documentation
¶
Index ¶
- func NewDHTable(ctx context.Context, opts ...Option) *distributedHashTable
- type Option
- func AddPeerCallbacks(cbs ...func(id warpnet.WarpPeerID)) Option
- func BootstrapNodes(nodes ...warpnet.WarpAddrInfo) Option
- func Network(network string) Option
- func Ratings(ratings PeersRatings) Option
- func RemovePeerCallbacks(cbs ...func(warpnet.WarpPeerID)) Option
- func RoutingStore(store RoutingStorer) Option
- type PeersRatings
- type RoutingStorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDHTable ¶
Types ¶
type Option ¶ added in v0.3.112
type Option func(*dhtConfig)
func AddPeerCallbacks ¶ added in v0.3.112
func AddPeerCallbacks(cbs ...func(id warpnet.WarpPeerID)) Option
func BootstrapNodes ¶ added in v0.3.112
func BootstrapNodes(nodes ...warpnet.WarpAddrInfo) Option
func Ratings ¶ added in v0.8.77
func Ratings(ratings PeersRatings) Option
Ratings is where the routing table reads whether it may hold a peer. Without it every peer is welcome.
func RemovePeerCallbacks ¶ added in v0.3.112
func RemovePeerCallbacks(cbs ...func(warpnet.WarpPeerID)) Option
func RoutingStore ¶ added in v0.3.112
func RoutingStore(store RoutingStorer) Option
type PeersRatings ¶ added in v0.8.77
type PeersRatings interface {
IsAllowedInDHT(peerID warpnet.WarpPeerID) bool
}
PeersRatings answers whether the routing table may hold a peer, which is the one place a rating refuses rather than slows.
type RoutingStorer ¶
type RoutingStorer interface {
warpnet.WarpBatching
}
Click to show internal directories.
Click to hide internal directories.