endpointfinder

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHTTPNotSupported = errors.New("provider does not support http")

ErrHTTPNotSupported indicates we were able to look up the provider and contact them, but they reported that they do not serve HTTP retrievals

Functions

This section is empty.

Types

type EndpointFinder

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

EndpointFinder handles translating SP miner addresses to HTTP retrieval endpoints for those miners, use the chain and the SP retrieval transports protocol. It also caches records for performance

func NewEndpointFinder

func NewEndpointFinder(minerInfoFetcher MinerInfoFetcher, h host.Host, opts ...Option) *EndpointFinder

NewEndpointFinder returns a new instance of an EndpointFinder

func (*EndpointFinder) FindHTTPEndpoints

func (ef *EndpointFinder) FindHTTPEndpoints(ctx context.Context, sps []string) ([]peer.AddrInfo, error)

FindHTTPEndpoints finds http endpoints for a given set of providers

type MinerInfoFetcher

type MinerInfoFetcher interface {
	GetProviderInfo(ctx context.Context, provider string) (*replication.MinerInfo, error)
}

MinerInfoFetcher is an interface for looking up chain miner info from an SP name

type Option added in v0.5.9

type Option func(*config)

func WithErrorLruSize added in v0.5.9

func WithErrorLruSize(size int) Option

func WithErrorLruTimeout added in v0.5.9

func WithErrorLruTimeout(timeout time.Duration) Option

func WithLruSize added in v0.5.9

func WithLruSize(size int) Option

func WithLruTimeout added in v0.5.9

func WithLruTimeout(timeout time.Duration) Option

Jump to

Keyboard shortcuts

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