redisbe

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ScanLimit = 500

max keys collected when browsing a key type from the tree view

Variables

View Source
var CommandHelps = []CommandHelp{}/* 227 elements not displayed */
View Source
var KeyTypes = []string{
	"string",
	"list",
	"set",
	"zset",
	"hash",
	"stream",
}

KeyTypes lists the key types offered by the key browser, in display order.

Functions

func FormatJson

func FormatJson(a any) (string, error)

Types

type Backend

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

Backend adapts the redis data-access layer to the db.KVBackend contract.

func Connect

func Connect(cfg Config) (*Backend, error)

Connect opens a redis connection and pings it before returning.

func (*Backend) Close

func (b *Backend) Close() error

func (*Backend) Do

func (b *Backend) Do(args []string) (string, error)

Do runs a raw redis command; the reply is rendered as indented JSON.

func (*Backend) ScanKeys

func (b *Backend) ScanKeys(keyType string) ([]string, error)

ScanKeys lists keys of one type, capped server-side at ScanLimit.

func (*Backend) Title

func (b *Backend) Title() string

func (*Backend) Value

func (b *Backend) Value(key string) (string, error)

Value fetches the value stored at key and renders it per key type.

type CommandHelp

type CommandHelp struct {
	Command string
	Args    string
	Version string
	Desc    string
}

type Config

type Config struct {
	UserName string
	Password string
	Host     string
	Port     string
	RdbNum   string
}

Config holds the connection parameters for a redis server. RdbNum is the logical database number as entered by the user (must parse as an integer).

type RDS

type RDS struct {
	// contains filtered or unexported fields
}
var (
	RdsClinet *RDS
)

func NewRDS

func NewRDS(rdsOpt *redis.Options) (*RDS, error)

func (*RDS) Close

func (rds *RDS) Close() error

Close closes the underlying redis client.

func (*RDS) ExecuteRawQuery

func (rds *RDS) ExecuteRawQuery(args []string) (string, error)

func (*RDS) GetValue

func (rds *RDS) GetValue(key string) (string, error)

func (*RDS) Scan

func (rds *RDS) Scan(cursor uint64, match string, count int64, keyType string) ([]string, error)

Jump to

Keyboard shortcuts

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