locator

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0, MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIndexLocator

func NewIndexLocator(indexer IndexerClient, authorizeRetrieval AuthorizeRetrievalFunc) *indexLocator

Types

type AuthorizeRetrievalFunc added in v0.4.0

type AuthorizeRetrievalFunc func(spaces []did.DID) (delegation.Delegation, error)

AuthorizeRetrievalFunc creates a content retrieval authorization for the provided space(s).

It should create a short lived delegation that allows the indexing service to retrieve indexes from the space(s).

type IndexerClient

type IndexerClient interface {
	QueryClaims(ctx context.Context, query types.Query) (types.QueryResult, error)
}

type Location

type Location struct {
	Commitment ucan.Capability[assert.LocationCaveats]
	Position   blobindex.Position
}

type Locator

type Locator interface {
	// Locate finds and returns the locations of a single block identified by its
	// digest. Returns a [NotFoundError] if no locations are found.
	Locate(ctx context.Context, spaces []did.DID, digest mh.Multihash) ([]Location, error)

	// LocateMany finds the locations of multiple blocks identified by their
	// digests, returning a map from digest to locations. Digests with no found
	// locations will be absent from the returned map.
	LocateMany(ctx context.Context, spaces []did.DID, digests []mh.Multihash) (blobindex.MultihashMap[[]Location], error)
}

type NotFoundError

type NotFoundError struct {
	Hash mh.Multihash
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

Jump to

Keyboard shortcuts

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