redisutil

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexVacuum

func IndexVacuum(ctx context.Context, c RedisIndexer, indexKey string, dataKeyPrefix Prefix) error

func JSONGet

func JSONGet(ctx context.Context, c RedisGetter, key string, v interface{}) error

func JSONSet

func JSONSet(ctx context.Context, c RedisSetter, key string, v interface{}, expiration time.Duration) error

Types

type Prefix

type Prefix string

func (Prefix) Add

func (p Prefix) Add(elem ...string) Prefix

func (Prefix) Key

func (p Prefix) Key(elem ...string) string

func (Prefix) Keys

func (p Prefix) Keys(list []string) []string

type RedisGetter

type RedisGetter interface {
	Get(context.Context, string) *redis.StringCmd
}

type RedisIndexer

type RedisIndexer interface {
	SMembers(ctx context.Context, key string) *redis.StringSliceCmd
	MGet(ctx context.Context, keys ...string) *redis.SliceCmd
	SRem(ctx context.Context, key string, members ...interface{}) *redis.IntCmd
}

type RedisSetter

type RedisSetter interface {
	Set(context.Context, string, interface{}, time.Duration) *redis.StatusCmd
}

Jump to

Keyboard shortcuts

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