rediscli

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedisTLSOptions added in v1.3.2

func RedisTLSOptions(tlsCfg *config.TLS) *tls.Config

RedisTLSOptions checks if Redis TLS is enabled in the configuration. If TLS is enabled, it loads the X509 key pair and creates a tls.Config object. The loaded certificate is added to the tls.Config object. If an error occurs while loading the key pair, it logs the error and returns nil. If Redis TLS is disabled, it returns nil.

Types

type Client added in v1.4.10

type Client interface {
	// GetWriteHandle retrieves the Redis client's write handle for operations requiring write access.
	GetWriteHandle() redis.UniversalClient

	// GetReadHandle retrieves a Redis client's read handle, supporting multiple read handles for load balancing.
	GetReadHandle() redis.UniversalClient

	// Close releases all resources associated with the client, including write and read handles, and closes any open connections.
	Close()
}

Client defines an interface for interacting with a Redis client with methods for initialization and handle retrieval.

func GetClient added in v1.4.10

func GetClient() Client

func NewClient added in v1.4.10

func NewClient() Client

NewClient creates and returns a new instance of a Redis client that implements the Client interface.

func NewTestClient added in v1.4.10

func NewTestClient(db *redis.Client) Client

NewTestClient initializes and returns a new testClient instance, implementing the Client interface using the provided Redis client.

Jump to

Keyboard shortcuts

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