objcacheredis

package
v0.0.0-...-202847b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL