Documentation
¶
Index ¶
- Constants
- Variables
- func Bootstrap(ctx context.Context, bootstrapPeers ...*peer.Peer) error
- func Lookup(ctx context.Context, opts ...LookupOption) (<-chan *peer.Peer, error)
- func WithBoostrapPeers(ps []*peer.Peer) func(*resolver)
- func WithEventbus(eb eventbus.Eventbus) func(*resolver)
- func WithExchange(x exchange.Exchange) func(*resolver)
- func WithKeychain(k keychain.Keychain) func(*resolver)
- type LookupFilter
- type LookupOption
- type LookupOptions
- type Option
- type Resolver
Constants ¶
View Source
const (
ErrNoPeersToAsk = errors.Error("no peers to ask")
)
Variables ¶
View Source
var ( DefaultResolver = New( context.Background(), WithEventbus(eventbus.DefaultEventbus), WithExchange(exchange.DefaultExchange), WithKeychain(keychain.DefaultKeychain), ) )
Functions ¶
func WithBoostrapPeers ¶
WithBoostrapPeers overrides the default bootstrap peers for the resolver.
func WithEventbus ¶
WithEventbus overrides the default eventbus for the resolver.
func WithExchange ¶
WithExchange overrides the default exchange for the resolver.
func WithKeychain ¶
WithKeychain overrides the default keychain for the resolver.
Types ¶
type LookupOption ¶
type LookupOption func(*LookupOptions)
LookupOptions
func LookupByCertificateSigner ¶
func LookupByCertificateSigner(certSigner crypto.PublicKey) LookupOption
LookupByCertificateSigner matches certificate signers
func LookupByContentHash ¶
func LookupByContentHash(hash object.Hash) LookupOption
LookupByContentHash matches content hashes
func LookupByContentType ¶
func LookupByContentType(contentType string) LookupOption
LookupByContentType matches content hashes
func LookupByOwner ¶
func LookupByOwner(keys ...crypto.PublicKey) LookupOption
LookupByOwner 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
Click to show internal directories.
Click to hide internal directories.