Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawler ¶
type Crawler struct {
// contains filtered or unexported fields
}
Crawler connects to hosts in the DHT to track routing tables of peers.
func (*Crawler) Run ¶
func (c *Crawler) Run(ctx context.Context, startingPeers []*peer.AddrInfo, handleSuccess HandleQueryResult, handleFail HandleQueryFail)
Run crawls dht peers from an initial seed of `startingPeers`
type HandleQueryFail ¶
HandleQueryFail is a callback on failed peer query
type HandleQueryResult ¶
HandleQueryResult is a callback on successful peer query
type Option ¶
type Option func(*options) error
Option DHT Crawler option type.
func WithConnectTimeout ¶
WithConnectTimeout defines the time for peer connection before timing out
func WithMsgTimeout ¶
WithMsgTimeout defines the amount of time a single DHT message is allowed to take before it's deemed failed
func WithParallelism ¶
WithParallelism defines the number of queries that can be issued in parallel
func WithProtocols ¶
WithProtocols defines the ordered set of protocols the crawler will use to talk to other nodes
Click to show internal directories.
Click to hide internal directories.