Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
Dialer encapsulates a libp2p host that dials peers.
func (*Dialer) StartDialing ¶
func (d *Dialer) StartDialing(ctx context.Context, dialQueue *queue.FIFO[peer.AddrInfo], resultsQueue *queue.FIFO[Result])
StartDialing enters an endless loop and consumes dial jobs from the dial queue and publishes its result on the results queue until it is told to stop or the dial queue was closed.
type Result ¶
type Result struct { DialerID string // The dialed peer Peer peer.AddrInfo // If error is set the peer was not dialable Error error // The above error transferred to a known error DialError string // When was the dial started DialStartTime time.Time // When did this crawl end DialEndTime time.Time }
Result captures data that is gathered from pinging a single peer.
func (*Result) DialDuration ¶
DialDuration returns the time it took to dial the peer
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
The Scheduler handles the scheduling and managing of
a) dialers - They consume a queue of peer address information, visit them and publish their results on a separate results queue. This results queue is consumed by this scheduler and further processed
func NewScheduler ¶
NewScheduler initializes a new libp2p host and scheduler instance.
Click to show internal directories.
Click to hide internal directories.