fetcher

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockFetcher

type BlockFetcher interface {
	// FetchBlocks retrieves blocks with the given cids from remote sources using the provided CandidateDownloadInfo
	FetchBlocks(ctx context.Context, cids []string, dss []*types.CandidateDownloadInfo) ([]*ErrMsg, []*types.Workload, []blocks.Block, error)
}

BlockFetcher is an interface for fetching blocks from remote sources

type CandidateFetcher

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

CandidateFetcher

func NewCandidateFetcher

func NewCandidateFetcher(httpClient *http.Client) *CandidateFetcher

NewCandidateFetcher creates a new CandidateFetcher with the specified timeout and retry count

func (*CandidateFetcher) FetchBlocks

func (c *CandidateFetcher) FetchBlocks(ctx context.Context, cids []string, dss []*types.CandidateDownloadInfo) ([]*ErrMsg, []*types.Workload, []blocks.Block, error)

FetchBlocks fetches blocks for the given cids and candidate download info

type ErrMsg added in v0.1.13

type ErrMsg struct {
	Cid    string
	Source string
	Msg    string
}

type IPFSClient

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

IPFSClient

func NewIPFSClient

func NewIPFSClient(ipfsAPIURL string) *IPFSClient

NewIPFSClient creates a new IPFSClient with the given API URL, timeout, and retry count

func (*IPFSClient) FetchBlocks

func (ipfs *IPFSClient) FetchBlocks(ctx context.Context, cids []string, downloadSources []*types.CandidateDownloadInfo) ([]*ErrMsg, []*types.Workload, []blocks.Block, error)

FetchBlocks retrieves blocks from IPFSClient using the provided context, CIDs, and download info

Jump to

Keyboard shortcuts

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