cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisClient

func NewRedisClient(addr, pw string, db int) *redis.Client

func SetCacheJSON

func SetCacheJSON(ctx context.Context, cache *Storage, key string, value any, ttl time.Duration)

Types

type Storage

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

func NewRedisStorage

func NewRedisStorage(rdb *redis.Client) *Storage

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, key string) error

func (*Storage) DeleteByPattern

func (s *Storage) DeleteByPattern(ctx context.Context, pattern string) error

func (*Storage) DeleteByPrefixes

func (s *Storage) DeleteByPrefixes(ctx context.Context, prefixes ...string) error

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, key string) (string, error)

func (*Storage) Ping

func (s *Storage) Ping(ctx context.Context) error

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, key string, value string, ttl time.Duration) error

Jump to

Keyboard shortcuts

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