Documentation ¶
Index ¶
- type BlockIndexRecord
- type BlockIndexStore
- type IndexingService
- func (l *IndexingService) Cache(ctx context.Context, provider peer.AddrInfo, claim delegation.Delegation) error
- func (l *IndexingService) Get(ctx context.Context, claim datamodel.Link) (delegation.Delegation, error)
- func (l *IndexingService) Publish(ctx context.Context, claim delegation.Delegation) error
- func (l *IndexingService) Query(ctx context.Context, q types.Query) (types.QueryResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockIndexRecord ¶
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 (l *IndexingService) Get(ctx context.Context, claim datamodel.Link) (delegation.Delegation, error)
func (*IndexingService) Publish ¶
func (l *IndexingService) Publish(ctx context.Context, claim delegation.Delegation) error
func (*IndexingService) Query ¶
func (l *IndexingService) Query(ctx context.Context, q types.Query) (types.QueryResult, error)