Documentation ¶
Index ¶
- type Cache
- type MemoryCache
- func (m MemoryCache[K, V]) All(_ context.Context) map[K]V
- func (m MemoryCache[K, V]) Clear(_ context.Context) bool
- func (m MemoryCache[K, V]) Delete(ctx context.Context, key K) bool
- func (m MemoryCache[K, V]) Get(_ context.Context, key K) (V, bool)
- func (m MemoryCache[K, V]) Has(_ context.Context, key K) bool
- func (m MemoryCache[K, V]) Set(ctx context.Context, key K, value V) bool
- type RedisCache
- func (r *RedisCache[K, V]) All(ctx context.Context) map[K]V
- func (r *RedisCache[K, V]) Clear(ctx context.Context) bool
- func (r *RedisCache[K, V]) Delete(ctx context.Context, key K) bool
- func (r *RedisCache[K, V]) Get(ctx context.Context, key K) (V, bool)
- func (r *RedisCache[K, V]) Has(ctx context.Context, key K) bool
- func (r *RedisCache[K, V]) Set(ctx context.Context, key K, value V) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCache ¶
type MemoryCache[K comparable, V any] struct { // contains filtered or unexported fields }
func NewMemoryCache ¶
func NewMemoryCache[K comparable, V any]() MemoryCache[K, V]
func (MemoryCache[K, V]) All ¶
func (m MemoryCache[K, V]) All(_ context.Context) map[K]V
type RedisCache ¶
type RedisCache[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedisCacheDriver ¶
func NewRedisCacheDriver[K comparable, V any](redisKey string, redisClient *redis.Client) *RedisCache[K, V]
func (*RedisCache[K, V]) All ¶
func (r *RedisCache[K, V]) All(ctx context.Context) map[K]V
Click to show internal directories.
Click to hide internal directories.