Documentation ¶
Index ¶
Constants ¶
const DefaultExpire = time.Hour
DefaultExpire is the expire time we set on Redis when Set/SetExpiration are called with expire=true
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(context.Context, string) *redis.StringCmd Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd Persist(ctx context.Context, key string) *redis.BoolCmd }
Client is a subset of functions from the golang redis client that we need to implement our cache
type ContentClaimsStore ¶
type ContentClaimsStore = Store[cid.Cid, delegation.Delegation]
ContentClaimsStore is a RedisStore for storing content claims that implements types.ContentClaimsStore
func NewContentClaimsStore ¶
func NewContentClaimsStore(client Client) *ContentClaimsStore
NewContentClaimsStore returns a new instance of a Content Claims Store using the given redis client
type ProviderStore ¶
type ProviderStore = Store[multihash.Multihash, []model.ProviderResult]
ProviderStore is a RedisStore for storing IPNI data that implements types.ProviderStore
func NewProviderStore ¶
func NewProviderStore(client Client) *ProviderStore
NewProviderStore returns a new instance of an IPNI store using the given redis client
type ShardedDagIndexStore ¶
type ShardedDagIndexStore = Store[types.EncodedContextID, blobindex.ShardedDagIndexView]
ShardedDagIndexStore is a RedisStore for storing sharded dag indexes that implements types.ShardedDagIndexStore
func NewShardedDagIndexStore ¶
func NewShardedDagIndexStore(client Client) *ShardedDagIndexStore
NewShardedDagIndexStore returns a new instance of a ShardedDagIndex store using the given redis client
type Store ¶
type Store[Key, Value any] struct { // contains filtered or unexported fields }
Store wraps the go redis client to implement our general purpose cache interface, using the providedserialization/deserialization functions
func NewStore ¶
func NewStore[Key, Value any]( fromRedis func(string) (Value, error), toRedis func(Value) (string, error), keyString func(Key) string, client Client) *Store[Key, Value]
NewStore returns a new instance of a redis store with the provided serialization/deserialization functions