redis

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package redis registers the "redis" driver for cachex.

Import this package once in your main function:

import _ "github.com/aisphereio/kernel/cachex/redis"

The driver uses github.com/redis/go-redis/v9 and supports:

  • Single-node mode (Config.Cluster = false)
  • Cluster mode (Config.Cluster = true, Addrs = seed nodes)
  • Sentinel mode (Config.MasterName != "", Addrs = sentinel addresses)
  • TLS (Config.TLSEnabled = true)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDirectClient

func NewDirectClient(cfg cachex.Config) (cachex.Cache, error)

NewDirectClient creates a cachex.Cache from the given Config without going through the driver registry. This is useful for tests where the Redis address is dynamic (e.g., miniredis).

In production code, use cachex.New(cfg) instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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