keyval

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegKeyValCreator

func RegKeyValCreator(typeName string, creator KeyValCreatorFunc)

Types

type KeyValClient

type KeyValClient interface {
	Set(key string, val interface{}, ttl ...time.Duration) error
	SetNX(key string, val interface{}, ttl ...time.Duration) bool
	Get(key string) string
	GetInt(key string) int
	Del(key string) error
	GetObject(key string, obj interface{}) error

	Incr(key string) int64
	Decr(key string) int64

	LPush(key string, val interface{}) error
	LPop(key string) string
	LPopCount(key string, count int) []string
	LPopInt(key string) int

	RPush(key string, val interface{}) error
	RPop(key string) string
	RPopCount(key string, count int) []string
	RPopInt(key string) int

	Len(key string) int64
	AtIndex(key string, index int64) string
	AtIndexInt(key string, index int64) int
	Range(key string, start int64, stop int64) []string

	HSet(key string, values map[string]interface{}) error
	HSetNX(key string, values map[string]interface{}) error
	HGet(key, field string) string
	HGetAll(key string) map[string]string
	HDel(key string, fields ...string) error
	HLen(key string) int
	HScan(key, pattern string, from, count int) map[string]string

	Expire(key string, ttl time.Duration) error
	Exist(key string) bool
}

func Get

func Get(name ...string) KeyValClient

type KeyValCreatorFunc

type KeyValCreatorFunc func(url string) (KeyValClient, error)

type RedisKeyVal

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

func (*RedisKeyVal) AtIndex

func (o *RedisKeyVal) AtIndex(key string, index int64) string

func (*RedisKeyVal) AtIndexInt

func (o *RedisKeyVal) AtIndexInt(key string, index int64) int

func (*RedisKeyVal) Decr

func (o *RedisKeyVal) Decr(key string) int64

func (*RedisKeyVal) Del

func (o *RedisKeyVal) Del(key string) error

func (*RedisKeyVal) Exist added in v0.0.28

func (o *RedisKeyVal) Exist(key string) bool

func (*RedisKeyVal) Expire

func (o *RedisKeyVal) Expire(key string, ttl time.Duration) error

func (*RedisKeyVal) Get

func (o *RedisKeyVal) Get(key string) string

func (*RedisKeyVal) GetInt

func (o *RedisKeyVal) GetInt(key string) int

func (*RedisKeyVal) GetObject added in v0.0.28

func (o *RedisKeyVal) GetObject(key string, obj interface{}) error

func (*RedisKeyVal) HDel

func (o *RedisKeyVal) HDel(key string, fields ...string) error

func (*RedisKeyVal) HGet

func (o *RedisKeyVal) HGet(key, field string) string

func (*RedisKeyVal) HGetAll

func (o *RedisKeyVal) HGetAll(key string) map[string]string

func (*RedisKeyVal) HLen

func (o *RedisKeyVal) HLen(key string) int

func (*RedisKeyVal) HScan

func (o *RedisKeyVal) HScan(key, pattern string, from, count int) map[string]string

func (*RedisKeyVal) HSet

func (o *RedisKeyVal) HSet(key string, values map[string]interface{}) error

func (*RedisKeyVal) HSetNX

func (o *RedisKeyVal) HSetNX(key string, values map[string]interface{}) error

func (*RedisKeyVal) Incr

func (o *RedisKeyVal) Incr(key string) int64

func (*RedisKeyVal) LPop

func (o *RedisKeyVal) LPop(key string) string

func (*RedisKeyVal) LPopCount

func (o *RedisKeyVal) LPopCount(key string, count int) []string

func (*RedisKeyVal) LPopInt

func (o *RedisKeyVal) LPopInt(key string) int

func (*RedisKeyVal) LPush

func (o *RedisKeyVal) LPush(key string, val interface{}) error

func (*RedisKeyVal) Len

func (o *RedisKeyVal) Len(key string) int64

func (*RedisKeyVal) RPop

func (o *RedisKeyVal) RPop(key string) string

func (*RedisKeyVal) RPopCount

func (o *RedisKeyVal) RPopCount(key string, count int) []string

func (*RedisKeyVal) RPopInt

func (o *RedisKeyVal) RPopInt(key string) int

func (*RedisKeyVal) RPush

func (o *RedisKeyVal) RPush(key string, val interface{}) error

func (*RedisKeyVal) Range

func (o *RedisKeyVal) Range(key string, start int64, stop int64) []string

func (*RedisKeyVal) Set

func (o *RedisKeyVal) Set(key string, val interface{}, ttl ...time.Duration) error

func (*RedisKeyVal) SetNX

func (o *RedisKeyVal) SetNX(key string, val interface{}, ttl ...time.Duration) bool

Jump to

Keyboard shortcuts

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