Documentation ¶
Index ¶
- func EvictOnSucces(ctx context.Context, client RedisClient, key string, err error) error
- func Load[V any](ctx context.Context, client RedisClient, key string, ...) (V, error)
- type App
- func (a *App[K, V]) EvictOnSuccess(ctx context.Context, item K, err error) error
- func (a *App[K, V]) Get(ctx context.Context, id K) (V, error)
- func (a App[K, V]) List(ctx context.Context, onMissError func(K, error) bool, items ...K) (outputs []V, err error)
- func (a App[K, V]) Store(ctx context.Context, id K, value V) error
- func (a *App[K, V]) WithMissMany(cb fetchMany[K, V])
- type IndexedItems
- type RedisClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvictOnSucces ¶ added in v4.48.0
Types ¶
type App ¶
type App[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any](client RedisClient, toKey func(K) string, onMiss fetch[K, V], ttl time.Duration, concurrency uint64, tracer trace.Tracer) *App[K, V]
func (*App[K, V]) EvictOnSuccess ¶ added in v4.47.2
func (App[K, V]) List ¶ added in v4.47.1
func (a App[K, V]) List(ctx context.Context, onMissError func(K, error) bool, items ...K) (outputs []V, err error)
If onMissError returns false, List stops by returning an error
func (*App[K, V]) WithMissMany ¶ added in v4.53.4
func (a *App[K, V]) WithMissMany(cb fetchMany[K, V])
type IndexedItems ¶ added in v4.53.6
type IndexedItems[K comparable] map[K]int
func (IndexedItems[K]) Items ¶ added in v4.53.6
func (ii IndexedItems[K]) Items() []K
type RedisClient ¶ added in v4.28.0
type RedisClient interface { Enabled() bool Load(ctx context.Context, key string) ([]byte, error) LoadMany(ctx context.Context, keys ...string) ([]string, error) Store(ctx context.Context, key string, value any, ttl time.Duration) error Delete(ctx context.Context, keys ...string) error Expire(ctx context.Context, ttl time.Duration, keys ...string) error Pipeline() redis.Pipeliner }
Click to show internal directories.
Click to hide internal directories.