redis

package
v0.0.0-...-e299d79 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	Client *redis.Client
}

RedisClient holds the Redis client

func NewRedisClient

func NewRedisClient(address string, password string, db int) *RedisClient

NewRedisClient creates a new Redis client

func (*RedisClient) Del

func (r *RedisClient) Del(keys ...string) error

Del deletes one or more keys from Redis

func (*RedisClient) Get

func (r *RedisClient) Get(key string) (string, error)

Get retrieves the value of a key from Redis

func (*RedisClient) Ping

func (r *RedisClient) Ping() error

Ping sends a ping to the Redis server

func (*RedisClient) Set

func (r *RedisClient) Set(key string, value interface{}, ttl ...int) 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