Documentation ¶
Index ¶
- type Callback
- type DropPeerFn
- type EventsRequesterFn
- type Fetcher
- func (f *Fetcher) Enqueue(peer string, inEvents inter.Events, t time.Time, fetchEvents EventsRequesterFn) error
- func (f *Fetcher) Notify(peer string, hashes hash.Events, time time.Time, fetchEvents EventsRequesterFn) error
- func (f *Fetcher) Overloaded() bool
- func (f *Fetcher) OverloadedPeer(peer string) bool
- func (f *Fetcher) Start()
- func (f *Fetcher) Stop()
- type FilterInterestedFn
- type PushEventFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback struct { PushEvent PushEventFn OnlyInterested FilterInterestedFn DropPeer DropPeerFn HeavyCheck *heavycheck.Checker FirstCheck func(*inter.Event) error }
type DropPeerFn ¶
type DropPeerFn func(peer string)
DropPeerFn is a callback type for dropping a peer detected as malicious.
type EventsRequesterFn ¶
EventsRequesterFn is a callback type for sending a event retrieval request.
type Fetcher ¶
Fetcher is responsible for accumulating event announcements from various peers and scheduling them for retrieval.
func (*Fetcher) Enqueue ¶
func (f *Fetcher) Enqueue(peer string, inEvents inter.Events, t time.Time, fetchEvents EventsRequesterFn) error
Enqueue tries to fill gaps the fetcher's future import queue.
func (*Fetcher) Notify ¶
func (f *Fetcher) Notify(peer string, hashes hash.Events, time time.Time, fetchEvents EventsRequesterFn) error
Notify announces the fetcher of the potential availability of a new event in the network.
func (*Fetcher) Overloaded ¶
Overloaded returns true if too much events are being processed or requested
func (*Fetcher) OverloadedPeer ¶
OverloadedPeer returns true if too much events are being processed or requested from the peer
type FilterInterestedFn ¶
FilterInterestedFn returns only event which may be requested.
type PushEventFn ¶
PushEventFn is a callback type to connect a received event