conn

package
v0.0.0-...-684d3d1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientPing

func ClientPing() error

ClientPing checks the user-specified `REDISEEN_REDIS_URI` (using default db 0)

Types

type ExtendedClient

type ExtendedClient struct {
	RedisClient *redis.Client
}

ExtendedClient is a struct type which helps extend Redis Client

func (*ExtendedClient) Init

func (client *ExtendedClient) Init(db int)

Init initiates and prepares a Redis client. Only Redis DB is needed as argument, since all other information will be provided via configuration

func (*ExtendedClient) ListKeys

func (client *ExtendedClient) ListKeys(regexpKeyPatternExposed *regexp.Regexp) []byte

ListKeys lists keys whose names match with REDISEEN_KEY_PATTERN_EXPOSED, together with their types, given a Redis client (in which logical DB is already specified). Only up to 1000 keys will be returned. In the response, we also give `count` and `total`. `count`<=1000, while `total` is the actual total number of keys whose names match with REDISEEN_KEY_PATTERN_EXPOSED

func (*ExtendedClient) RedisInfo

func (client *ExtendedClient) RedisInfo(section string, format string) ([]byte, error)

RedisInfo takes the results of Redis INFO command, then return the result as JSON ([]byte format from json.Marshal)

func (*ExtendedClient) Retrieve

func (client *ExtendedClient) Retrieve(key string, indexOrField string) ([]byte, int)

Retrieve handles requests to different Redis Data Types, and return values correspondingly

Jump to

Keyboard shortcuts

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