endpointfinder

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0, MIT Imports: 9 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, size int) (*EndpointFinder, error)

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

Jump to

Keyboard shortcuts

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