Documentation
¶
Overview ¶
Package redis registers the "redis" driver for cachex.
Import this package once in your main function:
import _ "github.com/aisphereio/kernel/cachex/redis"
The driver uses github.com/redis/go-redis/v9 and supports:
- Single-node mode (Config.Cluster = false)
- Cluster mode (Config.Cluster = true, Addrs = seed nodes)
- Sentinel mode (Config.MasterName != "", Addrs = sentinel addresses)
- TLS (Config.TLSEnabled = true)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDirectClient ¶
NewDirectClient creates a cachex.Cache from the given Config without going through the driver registry. This is useful for tests where the Redis address is dynamic (e.g., miniredis).
In production code, use cachex.New(cfg) instead.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.