redis

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package redis is the cache adapter for Redis and protocol-compatible servers (Valkey, KeyDB, Dragonfly).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(env core.Env, c *spec.Component) (any, error)

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (*Cache) Actions

func (r *Cache) Actions() []core.Action

func (*Cache) Activity

func (r *Cache) Activity(ctx context.Context) (core.Activity, error)

func (*Cache) Browse

func (r *Cache) Browse(ctx context.Context, path []string) (core.Table, bool, error)

Browse walks the server: databases with keys, a database's keys (the first 2000 a SCAN finds), then one key's value.

func (*Cache) Close

func (r *Cache) Close() error

func (*Cache) Delete

func (r *Cache) Delete(ctx context.Context, path []string, t core.Table, rows []int) error

Delete removes keys (a database's list) or entries of one key's value: hash fields, list items, set and sorted-set members, lines of a string.

func (*Cache) Do

func (r *Cache) Do(ctx context.Context, args ...string) (string, error)

func (*Cache) Info

func (r *Cache) Info(ctx context.Context) (map[string]string, error)

func (*Cache) Ping

func (r *Cache) Ping(ctx context.Context) error

func (*Cache) QueryAt

func (r *Cache) QueryAt(ctx context.Context, path []string, q string) (core.Table, error)

QueryAt runs a command against the database the path starts at (db0 when none).

func (*Cache) QueryLanguage

func (r *Cache) QueryLanguage() string

func (*Cache) RunQuery

func (r *Cache) RunQuery(ctx context.Context, q string) (core.Table, error)

func (*Cache) Set

func (r *Cache) Set(ctx context.Context, path []string, t core.Table, row, col int, value string) error

Set renames a key (a database's list) or writes one cell of a key's value.

func (*Cache) SuggestQuery

func (r *Cache) SuggestQuery(ctx context.Context, path []string) string

SuggestQuery reads a key the way its type is read; elsewhere it scans.

type Options

type Options struct {
	Addr     string `yaml:"addr"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
	// Unsafe allows commands that wipe or reconfigure the server (FLUSHALL, CONFIG SET, ...) from queries.
	Unsafe bool `yaml:"unsafe"`
}

Jump to

Keyboard shortcuts

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