redis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorType = fmt.Errorf("type error")

Functions

This section is empty.

Types

type ByteCache

type ByteCache struct {
	// contains filtered or unexported fields
}

func NewByteCache

func NewByteCache(client *redis.Client) *ByteCache

func (*ByteCache) Close

func (c *ByteCache) Close() error

func (*ByteCache) Del

func (c *ByteCache) Del(ctx context.Context, key string) error

func (*ByteCache) DelAll

func (c *ByteCache) DelAll(ctx context.Context) error

func (*ByteCache) Exists

func (c *ByteCache) Exists(ctx context.Context, key string) (bool, error)

func (*ByteCache) Get

func (c *ByteCache) Get(ctx context.Context, key string) ([]byte, bool, error)

func (*ByteCache) MultiDel

func (c *ByteCache) MultiDel(ctx context.Context, keys []string) error

func (*ByteCache) MultiGet

func (c *ByteCache) MultiGet(ctx context.Context, keys []string) (map[string][]byte, error)

func (*ByteCache) MultiSet

func (c *ByteCache) MultiSet(ctx context.Context, valMap map[string][]byte) error

func (*ByteCache) MultiSetWithTTL

func (c *ByteCache) MultiSetWithTTL(ctx context.Context, valMap map[string][]byte, expiration time.Duration) error

func (*ByteCache) Set

func (c *ByteCache) Set(ctx context.Context, key string, val []byte) error

func (*ByteCache) SetWithTTL

func (c *ByteCache) SetWithTTL(ctx context.Context, key string, val []byte, expiration time.Duration) error

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[T any](client *redis.Client, codec codec.Codec) *Cache[T]

func (*Cache[T]) Close

func (m *Cache[T]) Close() error

func (*Cache[T]) Del

func (m *Cache[T]) Del(ctx context.Context, key string) error

func (*Cache[T]) DelAll

func (m *Cache[T]) DelAll(ctx context.Context) error

func (*Cache[T]) Exists

func (m *Cache[T]) Exists(ctx context.Context, key string) (bool, error)

func (*Cache[T]) Get

func (m *Cache[T]) Get(ctx context.Context, key string) (T, bool, error)

func (*Cache[T]) MultiDel

func (m *Cache[T]) MultiDel(ctx context.Context, keys []string) error

func (*Cache[T]) MultiGet

func (m *Cache[T]) MultiGet(ctx context.Context, keys []string) (map[string]T, error)

func (*Cache[T]) MultiSet

func (m *Cache[T]) MultiSet(ctx context.Context, valMap map[string]T) error

func (*Cache[T]) MultiSetWithTTL

func (m *Cache[T]) MultiSetWithTTL(ctx context.Context, valMap map[string]T, expiration time.Duration) error

func (*Cache[T]) Set

func (m *Cache[T]) Set(ctx context.Context, key string, val T) error

func (*Cache[T]) SetWithTTL

func (m *Cache[T]) SetWithTTL(ctx context.Context, key string, val T, expiration time.Duration) error

Jump to

Keyboard shortcuts

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