Documentation ¶
Index ¶
- Constants
- type ContentHashesBloom
- type ContentHashesBloomRequest
- type CryptoFingerprintContentHashesBloomSyncMap
- func (m *CryptoFingerprintContentHashesBloomSyncMap) Delete(k crypto.Fingerprint)
- func (m *CryptoFingerprintContentHashesBloomSyncMap) Get(k crypto.Fingerprint) (*ContentHashesBloom, bool)
- func (m *CryptoFingerprintContentHashesBloomSyncMap) Put(k crypto.Fingerprint, v *ContentHashesBloom)
- func (m *CryptoFingerprintContentHashesBloomSyncMap) Range(i func(k crypto.Fingerprint, v *ContentHashesBloom) bool)
- type CryptoFingerprintPeerPeerSyncMap
- func (m *CryptoFingerprintPeerPeerSyncMap) Delete(k crypto.Fingerprint)
- func (m *CryptoFingerprintPeerPeerSyncMap) Get(k crypto.Fingerprint) (*peer.Peer, bool)
- func (m *CryptoFingerprintPeerPeerSyncMap) Put(k crypto.Fingerprint, v *peer.Peer)
- func (m *CryptoFingerprintPeerPeerSyncMap) Range(i func(k crypto.Fingerprint, v *peer.Peer) bool)
- type Discoverer
- func (r *Discoverer) FindByContent(ctx context.Context, contentHash string, opts ...discovery.Option) ([]crypto.Fingerprint, error)
- func (r *Discoverer) FindByFingerprint(ctx context.Context, fingerprint crypto.Fingerprint, opts ...discovery.Option) ([]*peer.Peer, error)
- func (r *Discoverer) LookupContentProvider(ctx context.Context, q bloom.Bloomer) ([]crypto.Fingerprint, error)
- func (r *Discoverer) LookupPeer(ctx context.Context, q *peer.PeerRequest) ([]*peer.Peer, error)
- type Store
- func (s *Store) AddContentHashes(c *ContentHashesBloom)
- func (s *Store) AddPeer(peer *peer.Peer)
- func (s *Store) FindByContent(b bloom.Bloomer) []*ContentHashesBloom
- func (s *Store) FindByFingerprint(fingerprint crypto.Fingerprint) []*peer.Peer
- func (s *Store) FindClosestContentProvider(q bloom.Bloomer) []*ContentHashesBloom
- func (s *Store) FindClosestPeer(f crypto.Fingerprint) []*peer.Peer
- type StringSyncList
Constants ¶
const (
ContentHashesBloomRequestType = "nimona.io/discovery/hyperspace/bloom.request"
)
const (
ContentHashesBloomType = "nimona.io/discovery/hyperspace/bloom"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentHashesBloom ¶ added in v0.4.0
type ContentHashesBloom struct { BloomFilter []int `json:"bloomFilter:ai"` Signature *crypto.Signature `json:"@signature:o"` }
ContentHashesBloom -
func (*ContentHashesBloom) Bloom ¶ added in v0.4.0
func (ch *ContentHashesBloom) Bloom() []int
func (*ContentHashesBloom) FromObject ¶ added in v0.4.0
func (s *ContentHashesBloom) FromObject(o object.Object) error
FromObject populates the struct from a f12n object
func (ContentHashesBloom) GetType ¶ added in v0.4.0
func (s ContentHashesBloom) GetType() string
GetType returns the object's type
func (ContentHashesBloom) ToObject ¶ added in v0.4.0
func (s ContentHashesBloom) ToObject() object.Object
ToObject returns a f12n object
type ContentHashesBloomRequest ¶ added in v0.4.0
type ContentHashesBloomRequest struct {
BloomFilter []int `json:"bloomFilter:ai"`
}
ContentHashesBloomRequest -
func (*ContentHashesBloomRequest) Bloom ¶ added in v0.4.0
func (ch *ContentHashesBloomRequest) Bloom() []int
func (*ContentHashesBloomRequest) FromObject ¶ added in v0.4.0
func (s *ContentHashesBloomRequest) FromObject(o object.Object) error
FromObject populates the struct from a f12n object
func (ContentHashesBloomRequest) GetType ¶ added in v0.4.0
func (s ContentHashesBloomRequest) GetType() string
GetType returns the object's type
func (ContentHashesBloomRequest) ToObject ¶ added in v0.4.0
func (s ContentHashesBloomRequest) ToObject() object.Object
ToObject returns a f12n object
type CryptoFingerprintContentHashesBloomSyncMap ¶ added in v0.4.0
type CryptoFingerprintContentHashesBloomSyncMap struct {
// contains filtered or unexported fields
}
CryptoFingerprintContentHashesBloomSyncMap -
func NewCryptoFingerprintContentHashesBloomSyncMap ¶ added in v0.4.0
func NewCryptoFingerprintContentHashesBloomSyncMap() *CryptoFingerprintContentHashesBloomSyncMap
NewCryptoFingerprintContentHashesBloomSyncMap constructs a new SyncMap
func (*CryptoFingerprintContentHashesBloomSyncMap) Delete ¶ added in v0.4.0
func (m *CryptoFingerprintContentHashesBloomSyncMap) Delete(k crypto.Fingerprint)
Delete -
func (*CryptoFingerprintContentHashesBloomSyncMap) Get ¶ added in v0.4.0
func (m *CryptoFingerprintContentHashesBloomSyncMap) Get(k crypto.Fingerprint) (*ContentHashesBloom, bool)
Get -
func (*CryptoFingerprintContentHashesBloomSyncMap) Put ¶ added in v0.4.0
func (m *CryptoFingerprintContentHashesBloomSyncMap) Put(k crypto.Fingerprint, v *ContentHashesBloom)
Put -
func (*CryptoFingerprintContentHashesBloomSyncMap) Range ¶ added in v0.4.0
func (m *CryptoFingerprintContentHashesBloomSyncMap) Range(i func(k crypto.Fingerprint, v *ContentHashesBloom) bool)
Range -
type CryptoFingerprintPeerPeerSyncMap ¶ added in v0.4.0
type CryptoFingerprintPeerPeerSyncMap struct {
// contains filtered or unexported fields
}
CryptoFingerprintPeerPeerSyncMap -
func NewCryptoFingerprintPeerPeerSyncMap ¶ added in v0.4.0
func NewCryptoFingerprintPeerPeerSyncMap() *CryptoFingerprintPeerPeerSyncMap
NewCryptoFingerprintPeerPeerSyncMap constructs a new SyncMap
func (*CryptoFingerprintPeerPeerSyncMap) Delete ¶ added in v0.4.0
func (m *CryptoFingerprintPeerPeerSyncMap) Delete(k crypto.Fingerprint)
Delete -
func (*CryptoFingerprintPeerPeerSyncMap) Get ¶ added in v0.4.0
func (m *CryptoFingerprintPeerPeerSyncMap) Get(k crypto.Fingerprint) (*peer.Peer, bool)
Get -
func (*CryptoFingerprintPeerPeerSyncMap) Put ¶ added in v0.4.0
func (m *CryptoFingerprintPeerPeerSyncMap) Put(k crypto.Fingerprint, v *peer.Peer)
Put -
func (*CryptoFingerprintPeerPeerSyncMap) Range ¶ added in v0.4.0
func (m *CryptoFingerprintPeerPeerSyncMap) Range(i func(k crypto.Fingerprint, v *peer.Peer) bool)
Range -
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
Discoverer hyperspace
func NewDiscoverer ¶
func NewDiscoverer( ctx context.Context, network net.Network, exc exchange.Exchange, local *peer.LocalPeer, bootstrapAddresses []string, ) (*Discoverer, error)
NewDiscoverer returns a new hyperspace discoverer
func (*Discoverer) FindByContent ¶
func (r *Discoverer) FindByContent( ctx context.Context, contentHash string, opts ...discovery.Option, ) ([]crypto.Fingerprint, error)
FindByContent finds and returns peer infos from a content hash
func (*Discoverer) FindByFingerprint ¶
func (r *Discoverer) FindByFingerprint( ctx context.Context, fingerprint crypto.Fingerprint, opts ...discovery.Option, ) ([]*peer.Peer, error)
FindByFingerprint finds and returns peer infos from a fingerprint
func (*Discoverer) LookupContentProvider ¶ added in v0.4.0
func (r *Discoverer) LookupContentProvider( ctx context.Context, q bloom.Bloomer, ) ([]crypto.Fingerprint, error)
LookupContentProvider searches the network for content given a bloom filter
func (*Discoverer) LookupPeer ¶ added in v0.4.0
func (r *Discoverer) LookupPeer( ctx context.Context, q *peer.PeerRequest, ) ([]*peer.Peer, error)
LookupPeer does a network lookup given a query
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store holds peer content blooms and their fingerprints
func (*Store) AddContentHashes ¶ added in v0.4.0
func (s *Store) AddContentHashes(c *ContentHashesBloom)
Add content hashes
func (*Store) FindByContent ¶
func (s *Store) FindByContent(b bloom.Bloomer) []*ContentHashesBloom
FindByContent returns peers that match a given content hash
func (*Store) FindByFingerprint ¶
func (s *Store) FindByFingerprint( fingerprint crypto.Fingerprint, ) []*peer.Peer
FindByFingerprint returns peers that are signed by a fingerprint
func (*Store) FindClosestContentProvider ¶ added in v0.4.0
func (s *Store) FindClosestContentProvider(q bloom.Bloomer) []*ContentHashesBloom
FindClosestContentProvider returns peers that are "closet" to the given content
func (*Store) FindClosestPeer ¶ added in v0.4.0
func (s *Store) FindClosestPeer(f crypto.Fingerprint) []*peer.Peer
FindClosestPeer returns peers that closest resemble the query
type StringSyncList ¶ added in v0.4.0
type StringSyncList struct {
// contains filtered or unexported fields
}
StringSyncList -
func NewStringValueTypeSyncMap ¶ added in v0.4.0
func NewStringValueTypeSyncMap() *StringSyncList
NewStringValueTypeSyncMap constructs a new SyncMap
func (*StringSyncList) Exists ¶ added in v0.4.0
func (m *StringSyncList) Exists(k string) bool
Exists -
func (*StringSyncList) Range ¶ added in v0.4.0
func (m *StringSyncList) Range(i func(k string) bool)
Range -