Documentation ¶
Index ¶
- Variables
- func New(opts ...Option) message.Dialer
- type ConnectionRequest
- type Connector
- type DiscoveredLocal
- type DiscoveredPeers
- type Discoverer
- type DiscoveryRequest
- type DiscoveryResponse
- type Option
- type PersistentTracker
- func (t *PersistentTracker) All(addr multiaddr.Multiaddr, status api.KnownPeerStatus) []peer.ID
- func (t *PersistentTracker) Connect(ctx context.Context, req *ConnectionRequest) (message.Stream, error)
- func (t *PersistentTracker) DB() *peerdb.DB
- func (t *PersistentTracker) Discover(ctx context.Context, req *DiscoveryRequest) (DiscoveryResponse, error)
- func (t *PersistentTracker) Mark(peer peer.ID, addr multiaddr.Multiaddr, status api.KnownPeerStatus)
- func (t *PersistentTracker) Next(addr multiaddr.Multiaddr, status api.KnownPeerStatus) (peer.ID, bool)
- func (t *PersistentTracker) ScanPeers(duration time.Duration)
- func (t *PersistentTracker) Status(peer peer.ID, addr multiaddr.Multiaddr) api.KnownPeerStatus
- func (t *PersistentTracker) Stop()
- func (t *PersistentTracker) SuccessIsTooOld(l peerdb.LastStatus) bool
- type PersistentTrackerOptions
- type SimpleTracker
- func (t *SimpleTracker) All(service multiaddr.Multiaddr, status api.KnownPeerStatus) []peer.ID
- func (t *SimpleTracker) Mark(peer peer.ID, service multiaddr.Multiaddr, status api.KnownPeerStatus)
- func (t *SimpleTracker) Next(service multiaddr.Multiaddr, status api.KnownPeerStatus) (peer.ID, bool)
- func (t *SimpleTracker) Status(peer peer.ID, service multiaddr.Multiaddr) api.KnownPeerStatus
- type Tracker
Constants ¶
This section is empty.
Variables ¶
View Source
var FakeTracker fakeTracker
Functions ¶
Types ¶
type ConnectionRequest ¶
type DiscoveredPeers ¶
type Discoverer ¶
type Discoverer interface {
Discover(context.Context, *DiscoveryRequest) (DiscoveryResponse, error)
}
type DiscoveryRequest ¶
type DiscoveryResponse ¶
type DiscoveryResponse interface {
// contains filtered or unexported methods
}
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithConnector ¶
func WithDiscoverer ¶
func WithDiscoverer(v Discoverer) Option
func WithTracker ¶
type PersistentTracker ¶
type PersistentTracker struct {
// contains filtered or unexported fields
}
func NewPersistentTracker ¶
func NewPersistentTracker(ctx context.Context, opts PersistentTrackerOptions) (*PersistentTracker, error)
func (*PersistentTracker) All ¶
func (t *PersistentTracker) All(addr multiaddr.Multiaddr, status api.KnownPeerStatus) []peer.ID
func (*PersistentTracker) Connect ¶
func (t *PersistentTracker) Connect(ctx context.Context, req *ConnectionRequest) (message.Stream, error)
func (*PersistentTracker) DB ¶
func (t *PersistentTracker) DB() *peerdb.DB
func (*PersistentTracker) Discover ¶
func (t *PersistentTracker) Discover(ctx context.Context, req *DiscoveryRequest) (DiscoveryResponse, error)
func (*PersistentTracker) Mark ¶
func (t *PersistentTracker) Mark(peer peer.ID, addr multiaddr.Multiaddr, status api.KnownPeerStatus)
func (*PersistentTracker) Next ¶
func (t *PersistentTracker) Next(addr multiaddr.Multiaddr, status api.KnownPeerStatus) (peer.ID, bool)
func (*PersistentTracker) ScanPeers ¶
func (t *PersistentTracker) ScanPeers(duration time.Duration)
func (*PersistentTracker) Status ¶
func (t *PersistentTracker) Status(peer peer.ID, addr multiaddr.Multiaddr) api.KnownPeerStatus
func (*PersistentTracker) Stop ¶
func (t *PersistentTracker) Stop()
func (*PersistentTracker) SuccessIsTooOld ¶ added in v1.4.0
func (t *PersistentTracker) SuccessIsTooOld(l peerdb.LastStatus) bool
type SimpleTracker ¶
type SimpleTracker struct {
// contains filtered or unexported fields
}
func (*SimpleTracker) All ¶
func (t *SimpleTracker) All(service multiaddr.Multiaddr, status api.KnownPeerStatus) []peer.ID
func (*SimpleTracker) Mark ¶
func (t *SimpleTracker) Mark(peer peer.ID, service multiaddr.Multiaddr, status api.KnownPeerStatus)
func (*SimpleTracker) Next ¶
func (t *SimpleTracker) Next(service multiaddr.Multiaddr, status api.KnownPeerStatus) (peer.ID, bool)
func (*SimpleTracker) Status ¶
func (t *SimpleTracker) Status(peer peer.ID, service multiaddr.Multiaddr) api.KnownPeerStatus
type Tracker ¶
type Tracker interface { Mark(peer peer.ID, service multiaddr.Multiaddr, status api.KnownPeerStatus) Status(peer peer.ID, service multiaddr.Multiaddr) api.KnownPeerStatus Next(service multiaddr.Multiaddr, status api.KnownPeerStatus) (peer.ID, bool) All(service multiaddr.Multiaddr, status api.KnownPeerStatus) []peer.ID }
Click to show internal directories.
Click to hide internal directories.