Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisByURLClient ¶
func NewRedisByURLClient[K comparable](rawURL string) objcache.NewStorageFn[K]
NewRedisByURLClient connects to a Redis server at the given URL using the HTTP URI scheme. URLs should follow the draft IANA specification for the scheme (https://www.iana.org/assignments/uri-schemes/prov/redis). This option function sets the connection as cache backend to the Service.
On error, while parsing the rawURL, this function will leak sensitive data, for now.
For example:
redis://localhost:6379/?db=3 redis://localhost:6379/?max_active=50&max_idle=5&idle_timeout=10s&max_conn_lifetime=1m&key_prefix=xcache_
func NewRedisClient ¶
func NewRedisClient[K comparable](pool *redis.Pool, ro *RedisOption) objcache.NewStorageFn[K]
NewRedisClient connects to the Redis server and does a ping to check if the connection works correctly.
Types ¶
type RedisOption ¶
type RedisOption struct {
KeyPrefix string
}
RedisOption applies several options for the Redis client.
Click to show internal directories.
Click to hide internal directories.