dht

package
v0.8.83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0, AGPL-3.0-or-later, Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDHTable

func NewDHTable(ctx context.Context, opts ...Option) *distributedHashTable

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 Network added in v0.6.89

func Network(network string) 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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL