Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedisTLSOptions ¶ added in v1.3.2
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 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
NewTestClient initializes and returns a new testClient instance, implementing the Client interface using the provided Redis client.