redis

package
v1.17.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TTL            int  = 300
	ModeStandalone Mode = "standalone"
	ModeSentinel   Mode = "sentinel"
	ModeCluster    Mode = "cluster"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode added in v1.17.0

type Mode string

Mode define the Redis connection mode supported

type RedisConnection

type RedisConnection struct {
	Mode           Mode
	Address        []string
	DB             int
	MasterName     string
	Password       string
	Protocol       int
	UseTLS         bool
	Logger         log.Logger
	Connected      bool
	Client         redis.UniversalClient
	CACertPath     *string
	ClientCertPath *string
	ClientKeyPath  *string
}

RedisConnection this struct represent a Redis connection hub

func (*RedisConnection) BuildTLSConfig added in v1.17.0

func (rc *RedisConnection) BuildTLSConfig(caCertPath, clientCertPath, clientKeyPath *string) (*tls.Config, error)

BuildTLSConfig generates a *tls.Config configuration for GCP #nosec G304

func (*RedisConnection) Close added in v1.12.1

func (rc *RedisConnection) Close() error

Close closes the Redis connection

func (*RedisConnection) Connect

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

Connect initializes a Redis connection

func (*RedisConnection) GetClient

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

GetClient always returns a pointer to a Redis client

Jump to

Keyboard shortcuts

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