Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCache ¶
func WithCache[T any]( ctx context.Context, cache *redisCache.Cache, cacheKey string, ttl time.Duration, fetchFunc func(ctx context.Context) (T, error), optChains ...*Option, ) (T, error)
WithCache cache encapsulation, slice please use SliceWrapper WithCache(ctx,cache,cacheKey,ttl,func(ctx context.Context) (*SliceWrapper[T],err)
Types ¶
type SliceWrapper ¶ added in v0.7.8
type SliceWrapper[T any] struct { L []T `json:"l" msgpack:"l"` }
Click to show internal directories.
Click to hide internal directories.