redis

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package redis is the redis implementation of the Trickster Cache and supports Standalone, Sentinel and Cluster

Index

Constants

View Source
const Redis = "redis"

Redis is the string "redis"

Variables

View Source
var ErrInvalidEndpointConfig = errors.New("invalid 'endpoint' config")

ErrInvalidEndpointConfig indicates an invalid endpoint config

View Source
var ErrInvalidEndpointsConfig = errors.New("invalid 'endpoints' config")

ErrInvalidEndpointsConfig indicates an invalid endpoints config

View Source
var ErrInvalidSentinalMasterConfig = errors.New("invalid 'sentinel_master' config")

ErrInvalidSentinalMasterConfig indicates an invalid sentinel_master config

Functions

This section is empty.

Types

type CacheClient

type CacheClient struct {
	Name   string
	Config *options.Options
	// contains filtered or unexported fields
}

CacheClient represents a redis cache client that conforms to the cache.Client interface

func New

func New(ctx context.Context, name string, cfg *options.Options) *CacheClient

func (*CacheClient) Close

func (c *CacheClient) Close() error

func (*CacheClient) Connect

func (c *CacheClient) Connect() error

Connect connects to the configured Redis endpoint

func (*CacheClient) Remove

func (c *CacheClient) Remove(cacheKeys ...string) error

func (*CacheClient) Retrieve

func (c *CacheClient) Retrieve(cacheKey string) ([]byte, status.LookupStatus, error)

Retrieve gets data from the Redis Cache using the provided Key because Redis manages Object Expiration internally, allowExpired is not used.

func (*CacheClient) Store

func (c *CacheClient) Store(cacheKey string, data []byte, ttl time.Duration) error

Store places the the data into the Redis Cache using the provided Key and TTL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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