mredis

package
v1.29.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const RedisTTL = 300

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisConnection

type RedisConnection struct {
	Addr      string
	User      string
	Password  string
	DB        int
	Protocol  int
	Client    *redis.Client
	Connected bool
	Logger    mlog.Logger
}

RedisConnection is a hub which deal with redis connections.

func (*RedisConnection) Connect

func (rc *RedisConnection) Connect(ctx context.Context) error

Connect keeps a singleton connection with redis.

func (*RedisConnection) GetClient

func (rc *RedisConnection) GetClient(ctx context.Context) (*redis.Client, error)

GetClient returns a pointer to the redis connection, initializing it if necessary.

Jump to

Keyboard shortcuts

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