Documentation ¶
Index ¶
- Constants
- func GetRedisClientCtx(ctx context.Context) *redis.Client
- func GetRedisClientReq(r *http.Request) *redis.Client
- func OpenClient(o RedisOptions) *redis.Client
- func TestConnection(o RedisOptions)
- func UseRedisConfig(next http.HandlerFunc, config RedisOptions) http.HandlerFunc
- type RedisOptions
Constants ¶
View Source
const RedisConfigKey = "redisConfig"
Variables ¶
This section is empty.
Functions ¶
func GetRedisClientCtx ¶
func GetRedisClientReq ¶
func OpenClient ¶
func OpenClient(o RedisOptions) *redis.Client
OpenClient creates a new redis client.
func TestConnection ¶
func TestConnection(o RedisOptions)
TestConnection fails if the connection can not be established
func UseRedisConfig ¶
func UseRedisConfig(next http.HandlerFunc, config RedisOptions) http.HandlerFunc
Types ¶
type RedisOptions ¶
RedisOptions configures all important redis parameter.
func GetRedisConfigCtx ¶
func GetRedisConfigCtx(ctx context.Context) RedisOptions
func GetRedisConfigReq ¶
func GetRedisConfigReq(r *http.Request) RedisOptions
func NewDefaultRedisOptions ¶
func NewDefaultRedisOptions() RedisOptions
NewDefaultRedisOptions returns the default redis options.
func ParseViperConfig ¶
func ParseViperConfig() RedisOptions
ParseViperConfig tries to map a viper configuration to LoggingOptions
Click to show internal directories.
Click to hide internal directories.