retriever

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: Apache-2.0, MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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