redisutil

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, config *Config) error

CheckRedis checks the Redis connection.

func NewRedisClient

func NewRedisClient(ctx context.Context, config *Config) (redis.UniversalClient, error)

Types

type Config

type Config struct {
	ClusterMode bool     // Whether to use Redis in cluster mode.
	Address     []string // List of Redis server addresses (host:port).
	Username    string   // Username for Redis authentication (Redis 6 ACL).
	Password    string   // Password for Redis authentication.
	MaxRetry    int      // Maximum number of retries for a command.
	DB          int      // Database number to connect to, for non-cluster mode.
	PoolSize    int      // Number of connections to pool.
}

Config defines the configuration parameters for a Redis client, including options for both single-node and cluster mode connections.

Jump to

Keyboard shortcuts

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