Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discoverer ¶
type Discoverer interface { AddProvider(provider Provider) error Add(v *peer.PeerInfo) // AddPersistent(v *peer.PeerInfo) FindByFingerprint( ctx context.Context, fingerprint string, opts ...Option, ) ([]*peer.PeerInfo, error) FindByContent( ctx context.Context, contentHash string, opts ...Option, ) ([]*peer.PeerInfo, error) }
Discoverer interface
func NewDiscoverer ¶
func NewDiscoverer() Discoverer
NewDiscoverer creates a new empty discoverer with no providers
type Options ¶
type Options struct {
Local bool
}
Options is the complete options structure for the discoverer
func ParseOptions ¶
type Provider ¶
type Provider interface { FindByFingerprint( ctx context.Context, fingerprint string, opts ...Option, ) ([]*peer.PeerInfo, error) FindByContent( ctx context.Context, contentHash string, opts ...Option, ) ([]*peer.PeerInfo, error) }
Provider defines the interface for a discoverer provider, eg our DHT
Click to show internal directories.
Click to hide internal directories.