ingest

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ingester

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

Ingester is a type that uses go-legs for the ingestion protocol.

func NewIngester added in v0.2.0

func NewIngester(cfg config.Ingest, h host.Host, idxr *indexer.Engine, reg *registry.Registry, ds datastore.Batching) (*Ingester, error)

NewIngester creates a new Ingester that uses a go-legs Subscriber to handle communication with providers.

func (*Ingester) Close added in v0.2.0

func (ing *Ingester) Close() error

func (*Ingester) Sync

func (ing *Ingester) Sync(ctx context.Context, peerID peer.ID, peerAddr multiaddr.Multiaddr) (<-chan multihash.Multihash, error)

Sync syncs the latest advertisement from a publisher. This is done by first fetching the latest advertisement ID from and traversing it until traversal gets to the last seen advertisement. Then the entries in each advertisement are synced and the multihashes in each entry are indexed.

The Context argument controls the lifetime of the sync. Canceling it cancels the sync and causes the multihash channel to close without any data.

Note that the multihash entries corresponding to the advertisement are synced in the background. The completion of advertisement sync does not necessarily mean that the entries corresponding to the advertisement are synced.

Jump to

Keyboard shortcuts

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