indexerlookup

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0, MIT Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexerCandidateFinder

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

func NewCandidateFinder

func NewCandidateFinder(o ...Option) (*IndexerCandidateFinder, error)

func (*IndexerCandidateFinder) FindCandidates

func (idxf *IndexerCandidateFinder) FindCandidates(ctx context.Context, cid cid.Cid) ([]types.RetrievalCandidate, error)

func (*IndexerCandidateFinder) FindCandidatesAsync added in v0.4.0

func (idxf *IndexerCandidateFinder) FindCandidatesAsync(ctx context.Context, c cid.Cid, cb func(types.RetrievalCandidate)) error

type Option added in v0.4.0

type Option func(*options) error

func WithAsyncResultsChanBuffer added in v0.4.0

func WithAsyncResultsChanBuffer(i int) Option

WithAsyncResultsChanBuffer sets the channel buffer returned by IndexerCandidateFinder.FindCandidatesAsync. Defaults to 1 if unspecified.

func WithHttpClient added in v0.4.0

func WithHttpClient(c *http.Client) Option

WithHttpClient sets the http.Client used to contact the indexer. Defaults to http.DefaultClient if unspecified.

func WithHttpClientTimeout added in v0.4.0

func WithHttpClientTimeout(t time.Duration) Option

WithHttpClientTimeout sets the timeout for the HTTP requests sent to the indexer. Defaults to one minute if unspecified.

func WithHttpEndpoint added in v0.4.0

func WithHttpEndpoint(e *url.URL) Option

WithHttpEndpoint sets the indexer HTTP API endpoint. Defaults to https://cid.contact if unspecified.

func WithHttpUserAgent added in v0.4.0

func WithHttpUserAgent(a string) Option

WithHttpUserAgent sets the User-Agent header value when contacting the indexer HTTP API. Setting this option to empty string will disable inclusion of User-Agent header. Defaults to "lassie" if unspecified.

func WithIpfsDhtCascade added in v0.4.0

func WithIpfsDhtCascade(b bool) Option

WithIpfsDhtCascade sets weather to cascade lookups onto the IPFS DHT. Enabled by default if unspecified.

func WithLegacyCascade added in v0.6.9

func WithLegacyCascade(b bool) Option

WithLegacyCascade sets weather to cascade finds legacy providers connecting only over bitswap Enabled by default if unspecified.

Jump to

Keyboard shortcuts

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