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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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