Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // WriteHandle is a variable of type `redis.UniversalClient` that represents the system wide redis pool (writes). WriteHandle redis.UniversalClient //nolint:gochecknoglobals // System wide redis pool // ReadHandle is a variable of type `redis.UniversalClient` that represents the system wide redis pool (reads). ReadHandle redis.UniversalClient //nolint:gochecknoglobals // System wide redis pool )
Functions ¶
func NewDNSResolver ¶
NewDNSResolver creates a new DNS resolver based on the configured settings.
func NewRedisClient ¶
func NewRedisClient() (redisHandle redis.UniversalClient)
NewRedisClient creates a new Redis client based on the configuration settings. It checks whether a Redis cluster is specified in the configuration and creates a cluster client if so. If a Redis sentinel setup is specified in the configuration, it creates a failover client. For a standalone Redis setup, it creates a regular Redis client. The created Redis client is then returned as a universal client.
func NewRedisReplicaClient ¶
func NewRedisReplicaClient() redis.UniversalClient
NewRedisReplicaClient is a function that returns a Redis replica client based on the configuration settings. If there are cluster addresses configured, it returns nil. If there are multiple sentinel addresses and a master address is configured, it returns a failover client. If the replica address is different from the master address, it returns a regular client using the replica address. Otherwise, it returns nil.
Types ¶
This section is empty.