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(peer *peer.Peer) FindByFingerprint( ctx context.Context, fingerprint crypto.Fingerprint, opts ...Option, ) ([]*peer.Peer, error) FindByContent( ctx context.Context, contentHash string, opts ...Option, ) ([]crypto.Fingerprint, 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 crypto.Fingerprint, opts ...Option, ) ([]*peer.Peer, error) FindByContent( ctx context.Context, contentHash string, opts ...Option, ) ([]crypto.Fingerprint, error) }
Provider defines the interface for a discoverer provider, eg our DHT
type StringPeerPeerSyncMap ¶ added in v0.4.0
type StringPeerPeerSyncMap struct {
// contains filtered or unexported fields
}
StringPeerPeerSyncMap -
func NewStringPeerPeerSyncMap ¶ added in v0.4.0
func NewStringPeerPeerSyncMap() *StringPeerPeerSyncMap
NewStringPeerPeerSyncMap constructs a new SyncMap
func (*StringPeerPeerSyncMap) Delete ¶ added in v0.4.0
func (m *StringPeerPeerSyncMap) Delete(k string)
Delete -
func (*StringPeerPeerSyncMap) Get ¶ added in v0.4.0
func (m *StringPeerPeerSyncMap) Get(k string) (*peer.Peer, bool)
Get -
Click to show internal directories.
Click to hide internal directories.