retriever

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Overview

Package retriever wraps functionality for fetching data from filecoin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointFinder

type EndpointFinder interface {
	FindHTTPEndpoints(ctx context.Context, sps []string) ([]peer.AddrInfo, error)
}

EndpointFinder finds http endpoints for set of SPs

type Retriever

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

Retriever wraps Lassie and HTTP endpoint lookup to returns a byte stream for a cid at the root of a unixfs tree, from a list of Filecoin providers

func NewRetriever

func NewRetriever(lassie lassietypes.Fetcher, endpointFinder EndpointFinder) *Retriever

NewRetriever returns a new retriever instance

func (*Retriever) Retrieve

func (r *Retriever) Retrieve(ctx context.Context, c cid.Cid, rangeStart int64, rangeEnd int64, sps []string, out io.Writer) error

Retrieve retrieves a byte range from a cid representing a unixfstree from a given list of SPs, writing the output to a car file

func (*Retriever) RetrieveReader added in v0.5.6

func (r *Retriever) RetrieveReader(ctx context.Context, c cid.Cid, rangeStart int64, rangeEnd int64, sps []string) (io.ReadCloser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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