redis

package
v0.0.0-...-3bd2bae Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 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
	// contains filtered or unexported fields
}

RedisClient

func NewRedisClient

func NewRedisClient(ctx context.Context, url string, pass string) (*RedisClient, error)

RedisClient

func (*RedisClient) Close

func (rdb *RedisClient) Close() error

Close closes the redis connection

func (*RedisClient) Get

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

Get

func (*RedisClient) Publish

func (rdb *RedisClient) Publish(key string, value string) error

Publish

func (*RedisClient) Set

func (rdb *RedisClient) Set(key string, value string, ttl time.Duration) error

Set

func (*RedisClient) Subscribe

func (rdb *RedisClient) Subscribe(ctx context.Context, key string) (*redis.PubSub, chan []byte, error)

Subscribe to redis channel and return a channel of messages

Jump to

Keyboard shortcuts

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