legacy

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockIndexRecord

type BlockIndexRecord struct {
	CarPath string
	Offset  uint64
	Length  uint64
}

type BlockIndexStore

type BlockIndexStore interface {
	Query(ctx context.Context, digest multihash.Multihash) ([]BlockIndexRecord, error)
}

type IndexingService

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

func NewService

func NewService(id principal.Signer, indexer types.Service, blockIndexStore BlockIndexStore, bucketURL string) (*IndexingService, error)

NewService creates a new indexing service that wraps the passed service and transparently proxies to it, with the exception of the call to [Query], which calls the wrapped service and then inspects the results. If they are empty then it will query the blockIndexStore - a giant index of historical data, mapping multihashes to bucket keys/URLs and their byte offsets.

The data referenced by bucket keys in the blockIndexStore has been consolidated into a single bucket. So this instance does the work of mapping old bucket keys to URLs, where the base URL is the passed bucketURL param.

Using the data in the blockIndexStore, the service will materialize content claims using the id param as the signing key, and add them to the query results before returning them back to the caller.

func (*IndexingService) Cache

func (l *IndexingService) Cache(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation) error

func (*IndexingService) Get

func (*IndexingService) Publish

func (l *IndexingService) Publish(ctx context.Context, claim delegation.Delegation) error

func (*IndexingService) Query

Jump to

Keyboard shortcuts

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