blobindexlookup

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobIndexLookup

type BlobIndexLookup interface {
	// Find should:
	// 1. attempt to read the sharded dag index from the cache from the encoded contextID
	// 2. if not found, attempt to fetch the index from the provided URL. Store the result in cache
	// 3. return the index
	// 4. asyncronously, add records to the ProviderStore from the parsed blob index so that we can avoid future queries to IPNI for
	// other multihashes in the index
	Find(ctx context.Context, contextID types.EncodedContextID, provider model.ProviderResult, fetchURL url.URL, rng *metadata.Range) (blobindex.ShardedDagIndexView, error)
}

BlobIndexLookup is a read through cache for fetching blob indexes

func NewBlobIndexLookup

func NewBlobIndexLookup(httpClient *http.Client) BlobIndexLookup

func WithCache

func WithCache(blobIndexLookup BlobIndexLookup, shardedDagIndexCache types.ShardedDagIndexStore, cachingQueue CachingQueue) BlobIndexLookup

WithCache returns a blobIndexLookup that attempts to read blobs from the cache, and also caches providers asociated with index cids

type CachingQueue

type CachingQueue interface {
	Queue(ctx context.Context, job providercacher.ProviderCachingJob) error
}

CachingQueue can queue a provider record to be cached for all CIDs in an index

Jump to

Keyboard shortcuts

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