Documentation ¶
Overview ¶
package downloader contains a cache for downloading blocks from a renterd node. A cache optimizes the number of in-flight requests to avoid overloading the node and caches blocks to avoid redundant downloads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockDownloader ¶
type BlockDownloader struct {
// contains filtered or unexported fields
}
BlockDownloader is a cache for downloading blocks from a renterd node. It limits the number of in-flight requests to avoid overloading the node and caches blocks to avoid redundant downloads.
For UnixFS nodes, it also prefetches linked blocks.
func NewBlockDownloader ¶
func NewBlockDownloader(store MetadataStore, bucket string, cacheSize, workers int, workerClient *worker.Client, log *zap.Logger) (*BlockDownloader, error)
NewBlockDownloader creates a new BlockDownloader.
type MetadataStore ¶
type MetadataStore interface { BlockLocation(c cid.Cid) (bucket, key string, err error) BlockSiblings(c cid.Cid, max int) (siblings []cid.Cid, err error) BlockChildren(c cid.Cid, max int) (siblings []cid.Cid, err error) }
A MetadataStore is a store for IPFS block metadata. It is used to optimize block downloads by prefetching linked blocks.
Click to show internal directories.
Click to hide internal directories.