cache

package
v0.0.0-...-bf3307f Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCache

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

RedisCache implements caching using Redis

func NewRedisCache

func NewRedisCache(addr, password string, db int) *RedisCache

NewRedisCache creates a new Redis cache instance

func (*RedisCache) Close

func (c *RedisCache) Close() error

Close closes the Redis connection

func (*RedisCache) Delete

func (c *RedisCache) Delete(key string) error

Delete removes a value from cache

func (*RedisCache) Get

func (c *RedisCache) Get(key string) ([]byte, error)

Get retrieves a value from cache

func (*RedisCache) Set

func (c *RedisCache) Set(key string, value []byte, ttl int) error

Set stores a value in cache with TTL

Jump to

Keyboard shortcuts

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