hyperspace

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoPeersToAsk = errors.Error("no peers to ask")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoPublicKeyPeerPeerSyncMap added in v0.5.0

type CryptoPublicKeyPeerPeerSyncMap struct {
	// contains filtered or unexported fields
}

CryptoPublicKeyPeerPeerSyncMap -

func NewCryptoPublicKeyPeerPeerSyncMap added in v0.5.0

func NewCryptoPublicKeyPeerPeerSyncMap() *CryptoPublicKeyPeerPeerSyncMap

NewCryptoPublicKeyPeerPeerSyncMap constructs a new SyncMap

func (*CryptoPublicKeyPeerPeerSyncMap) Delete added in v0.5.0

Delete -

func (*CryptoPublicKeyPeerPeerSyncMap) Get added in v0.5.0

Get -

func (*CryptoPublicKeyPeerPeerSyncMap) Put added in v0.5.0

Put -

func (*CryptoPublicKeyPeerPeerSyncMap) Range added in v0.5.0

func (m *CryptoPublicKeyPeerPeerSyncMap) Range(i func(k crypto.PublicKey, v *peer.Peer) bool)

Range -

type Discoverer

type Discoverer struct {
	// contains filtered or unexported fields
}

Discoverer hyperspace

func NewDiscoverer

func NewDiscoverer(
	ctx context.Context,
	ps discovery.PeerStorer,
	exc exchange.Exchange,
	local *peer.LocalPeer,
	bootstrapAddresses []string,
) (*Discoverer, error)

NewDiscoverer returns a new hyperspace discoverer

func (*Discoverer) Lookup added in v0.5.0

func (r *Discoverer) Lookup(
	ctx context.Context,
	opts ...peer.LookupOption,
) (<-chan *peer.Peer, error)

Lookup finds and returns peer infos from a fingerprint

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds peer content blooms and their fingerprints

func NewStore

func NewStore() *Store

NewStore retuns empty store

func (*Store) AddPeer added in v0.4.0

func (s *Store) AddPeer(p *peer.Peer)

Add peers

func (*Store) Get added in v0.5.0

func (s *Store) Get(q bloom.Bloom) []*peer.Peer

Get returns peers that match a query

func (*Store) GetClosest added in v0.5.0

func (s *Store) GetClosest(q bloom.Bloom) []*peer.Peer

GetClosest returns peers that closest resemble the query

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL