redis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	Database int32
	Password string
}

Config holds all required info for initializing redis driver

type RedisCache

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

RedisCache holds the handler for the redisclient and auxiliary info

func NewCache

func NewCache(config *Config) (*RedisCache, error)

NewRedisClient inits a RedisCache instance

func (*RedisCache) Delete

func (rc *RedisCache) Delete(ctx context.Context, key string) error

Delete - deletes a key from redis

func (*RedisCache) Disconnect

func (rc *RedisCache) Disconnect() error

Disconnect ... disconnects from the redis server

func (*RedisCache) Get

func (rc *RedisCache) Get(ctx context.Context, key string) (interface{}, error)

Get - gets a value from redis

func (*RedisCache) Set

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

Set - sets a key value pair in redis

Jump to

Keyboard shortcuts

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