redis

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Driver

func Driver(client *goredis.Client, options ...cache.DriverOption) cache.Driver

Driver creates a Redis-backed cache driver.

func Provider added in v0.1.2

func Provider(items ...Option) runaprovider.Provider

Provider registers a Redis cache driver. It can use an injected client, explicit connection options, cache.redis config, redis shared config, or defaults.

Types

type Option added in v0.1.2

type Option func(*options)

Option configures Redis cache provider connection and driver registration.

func Addr added in v0.1.2

func Addr(value string) Option

Addr sets the Redis server address used when the driver creates its own client.

func Auth added in v0.1.2

func Auth(username string, password string) Option

Auth sets Redis username and password.

func Client added in v0.1.2

func Client(client *goredis.Client) Option

Client uses an existing Redis client. The driver will not close injected clients.

func Config added in v0.1.2

func Config(path string) Option

Config sets the feature-specific config path. Defaults to cache.redis.

func DB added in v0.1.2

func DB(value int) Option

DB sets Redis logical database index.

func DialTimeout added in v0.1.2

func DialTimeout(value time.Duration) Option

DialTimeout sets Redis dial timeout.

func MinIdle added in v0.1.2

func MinIdle(value int) Option

MinIdle sets Redis minimum idle connections.

func Name added in v0.1.2

func Name(value string) Option

Name sets the cache driver registration name used by Provider.

func Password added in v0.1.2

func Password(value string) Option

Password sets Redis password.

func PoolSize added in v0.1.2

func PoolSize(value int) Option

PoolSize sets Redis connection pool size.

func Prefix added in v0.1.2

func Prefix(value string) Option

Prefix sets Redis cache key prefix.

func ReadTimeout added in v0.1.2

func ReadTimeout(value time.Duration) Option

ReadTimeout sets Redis read timeout.

func TTL added in v0.1.2

func TTL(value time.Duration) Option

TTL sets default cache TTL.

func Use added in v0.1.2

func Use(name string) Option

Use selects the shared redis config name used by Provider.

func WriteTimeout added in v0.1.2

func WriteTimeout(value time.Duration) Option

WriteTimeout sets Redis write timeout.

Jump to

Keyboard shortcuts

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