Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDriver ¶ added in v1.2.7
RegisterDriver registers a Redis driver with the given name. It panics if the driver name has already been registered.
Types ¶
type Config ¶
type Config struct {
// Addr is the Redis server address, e.g., "127.0.0.1:6379"
Addr string `value:"${addr}"`
// Password is the Redis server password, default is empty.
Password string `value:"${password:=}"`
// Driver specifies which Redis driver to use, defaults to DefaultDriver.
Driver string `value:"${driver:=DefaultDriver}"`
}
Config defines Redis connection configuration.
type DefaultDriver ¶ added in v1.2.7
type DefaultDriver struct{}
DefaultDriver is the default implementation of the Driver interface.
func (DefaultDriver) CreateClient ¶ added in v1.2.7
func (DefaultDriver) CreateClient(c Config) (*redis.Pool, error)
CreateClient creates a new Redis client based on the provided configuration.
Click to show internal directories.
Click to hide internal directories.