types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("cache key not found")

ErrKeyNotFound means the key did not exist in the cache

Functions

This section is empty.

Types

type Cache

type Cache[Key, Value any] interface {
	Set(ctx context.Context, key Key, value Value, expires bool) error
	SetExpirable(ctx context.Context, key Key, expires bool) error
	Get(ctx context.Context, key Key) (Value, error)
}

Cache describes a generic cache interface

type ContentClaimsStore

type ContentClaimsStore Cache[cid.Cid, delegation.Delegation]

ContentClaimsStore caches fetched content claims

type ContextID

type ContextID struct {
	Space *did.DID
	Hash  mh.Multihash
}

ContextID describes the data used to calculate a context id for IPNI

func (ContextID) ToEncoded

func (c ContextID) ToEncoded() (EncodedContextID, error)

ToEncoded canonically encodes ContextID data

type EncodedContextID

type EncodedContextID []byte

EncodedContextID is the encoded form of context id data that is actually stored in IPNI

type ProviderStore

type ProviderStore Cache[mh.Multihash, []model.ProviderResult]

ProviderStore caches queries to IPNI

type ShardedDagIndexStore

type ShardedDagIndexStore Cache[EncodedContextID, blobindex.ShardedDagIndexView]

ShardedDagIndexStore caches fetched sharded dag indexes

Jump to

Keyboard shortcuts

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