Documentation ¶
Index ¶
Constants ¶
View Source
const (
ErrNoPeersToAsk = errors.Error("no peers to ask")
)
Variables ¶
This section is empty.
Functions ¶
func WithBoostrapPeers ¶
func WithBoostrapPeers(ps ...*peer.ConnectionInfo) func(*resolver)
WithBoostrapPeers overrides the default bootstrap peers for the resolver.
Types ¶
type LookupOption ¶
type LookupOption func(*LookupOptions)
LookupOptions
func LookupByContentHash ¶
func LookupByContentHash(hash object.Hash) LookupOption
LookupByContentHash matches content hashes
func LookupByPeerKey ¶ added in v0.14.1
func LookupByPeerKey(keys ...crypto.PublicKey) LookupOption
LookupByPeerKey matches the peer key
func LookupOnlyLocal ¶
func LookupOnlyLocal() LookupOption
LookupOnlyLocal forces the discoverer to only look at its cache
type LookupOptions ¶
type LookupOptions struct { Local bool // Lookups are strings we are looking for, will be used to create a // bloom filter when forwarding the lookup request to providers Lookups []string // filters are the lookups equivalents for matching local peers Filters []LookupFilter }
LookupOptions
func ParseLookupOptions ¶
func ParseLookupOptions(opts ...LookupOption) *LookupOptions
func (LookupOptions) Match ¶
func (l LookupOptions) Match(p *hyperspace.Announcement) bool
type Resolver ¶
type Resolver interface { Lookup( ctx context.Context, opts ...LookupOption, ) ([]*peer.ConnectionInfo, error) LookupPeer( ctx context.Context, publicKey crypto.PublicKey, ) (*peer.ConnectionInfo, error) }
Click to show internal directories.
Click to hide internal directories.