hyperspace

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announced

type Announced struct {
	AvailableContentBloom []int64             `json:"availableContentBloom:ai"`
	Nonce                 string              `json:"nonce:s"`
	Signature             *crypto.Signature   `json:"@signature:o"`
	Authors               []*crypto.PublicKey `json:"@authors:ao"`
}

func (*Announced) Bloom

func (ch *Announced) Bloom() []int64

func (*Announced) EventName

func (e *Announced) EventName() string

func (*Announced) FromObject

func (e *Announced) FromObject(o object.Object) error

func (*Announced) GetType

func (e *Announced) GetType() string

func (*Announced) ToObject

func (e *Announced) ToObject() object.Object

type CryptoFingerprintAnnouncedSyncMap

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

CryptoFingerprintAnnouncedSyncMap -

func NewCryptoFingerprintAnnouncedSyncMap

func NewCryptoFingerprintAnnouncedSyncMap() *CryptoFingerprintAnnouncedSyncMap

NewCryptoFingerprintAnnouncedSyncMap constructs a new SyncMap

func (*CryptoFingerprintAnnouncedSyncMap) Delete

Delete -

func (*CryptoFingerprintAnnouncedSyncMap) Get

Get -

func (*CryptoFingerprintAnnouncedSyncMap) Put

Put -

func (*CryptoFingerprintAnnouncedSyncMap) Range

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

Delete -

func (*CryptoFingerprintPeerPeerSyncMap) Get added in v0.4.0

Get -

func (*CryptoFingerprintPeerPeerSyncMap) Put added in v0.4.0

Put -

func (*CryptoFingerprintPeerPeerSyncMap) Range added in v0.4.0

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.Requested,
) ([]*peer.Peer, error)

LookupPeer does a network lookup given a query

type Request

type Request struct {
	QueryContentBloom []int64             `json:"queryContentBloom:ai"`
	Nonce             string              `json:"nonce:s"`
	Signature         *crypto.Signature   `json:"@signature:o"`
	Authors           []*crypto.PublicKey `json:"@authors:ao"`
}

func (*Request) Bloom

func (ch *Request) Bloom() []int64

func (*Request) EventName

func (e *Request) EventName() string

func (*Request) FromObject

func (e *Request) FromObject(o object.Object) error

func (*Request) GetType

func (e *Request) GetType() string

func (*Request) ToObject

func (e *Request) ToObject() object.Object

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) AddContentHashes added in v0.4.0

func (s *Store) AddContentHashes(c *Announced)

Add content hashes

func (*Store) AddPeer added in v0.4.0

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

Add peers

func (*Store) FindByContent

func (s *Store) FindByContent(b bloom.Bloomer) []*Announced

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) []*Announced

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) Delete added in v0.4.0

func (m *StringSyncList) Delete(k string)

Delete -

func (*StringSyncList) Exists added in v0.4.0

func (m *StringSyncList) Exists(k string) bool

Exists -

func (*StringSyncList) Put added in v0.4.0

func (m *StringSyncList) Put(k string)

Put -

func (*StringSyncList) Range added in v0.4.0

func (m *StringSyncList) Range(i func(k string) bool)

Range -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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