redis

package
v0.0.0-...-fad138e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("key not found")

Functions

func Connect

func Connect(o *Config) (err error)

func Decr

func Decr(key string) (int64, error)

func DecrBy

func DecrBy(key string, value int64) (int64, error)

func Del

func Del(keys ...string) (int64, error)

func Exists

func Exists(keys ...string) (bool, error)

func Expire

func Expire(key string, timeout time.Duration) (bool, error)

func FreqCheck

func FreqCheck(key string, limit int64, timeout time.Duration) (bool, error)

func FreqTryLock

func FreqTryLock(key string, limit int64, timeout time.Duration) (time.Duration, error)

func Get

func Get(key string) (string, error)

func GetFloat64

func GetFloat64(key string) (float64, error)

func GetInt64

func GetInt64(key string) (int64, error)

func GetJson

func GetJson(key string, j interface{}) error

func GetUint64

func GetUint64(key string) (uint64, error)

func HDecr

func HDecr(key string, field string) (int64, error)

func HDecrBy

func HDecrBy(key string, field string, increment int64) (int64, error)

func HDel

func HDel(key string, fields ...string) (int64, error)

func HExists

func HExists(key, field string) (bool, error)

func HGet

func HGet(key, field string) (string, error)

func HGetAll

func HGetAll(key string) (map[string]string, error)

func HGetJson

func HGetJson(key, field string, j interface{}) error

func HIncr

func HIncr(key string, subKey string) (int64, error)

func HIncrBy

func HIncrBy(key string, field string, increment int64) (int64, error)

func HIncrByFloat

func HIncrByFloat(key string, field string, increment float64) (float64, error)

func HKeys

func HKeys(key string) ([]string, error)

func HSet

func HSet(key string, field string, value interface{}) (bool, error)

func HVals

func HVals(key string) ([]string, error)

func Incr

func Incr(key string) (int64, error)

func IncrBy

func IncrBy(key string, value int64) (int64, error)

func IncrByFloat

func IncrByFloat(key string, increment float64) (float64, error)

func Lock

func Lock(key string, timeout time.Duration)

func SAdd

func SAdd(key string, members ...string) (int64, error)

func SISMember

func SISMember(key, field string) (bool, error)

func SMembers

func SMembers(key string) ([]string, error)

func SPop

func SPop(key string) (string, error)

func SRandMember

func SRandMember(key string, count ...int64) ([]string, error)

func SRem

func SRem(key string, members ...string) (int64, error)

func Set

func Set(key string, value interface{}) (bool, error)

func SetEx

func SetEx(key string, value interface{}, timeout time.Duration) (bool, error)

func SetNx

func SetNx(key string, value interface{}) (bool, error)

func SetNxWithTimeout

func SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error)

func TryLock

func TryLock(key string, timeout time.Duration) (bool, error)

func Ttl

func Ttl(key string) (time.Duration, error)

func Unlock

func Unlock(key string) error

Types

type Client

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

func NewClient

func NewClient(o *Config) (*Client, error)

func (*Client) Close

func (p *Client) Close() error

func (*Client) Decr

func (p *Client) Decr(key string) (int64, error)

func (*Client) DecrBy

func (p *Client) DecrBy(key string, value int64) (int64, error)

func (*Client) Del

func (p *Client) Del(keys ...string) (int64, error)

func (*Client) Exists

func (p *Client) Exists(keys ...string) (bool, error)

func (*Client) Expire

func (p *Client) Expire(key string, timeout time.Duration) (bool, error)

func (*Client) FreqCheck

func (p *Client) FreqCheck(key string, limit int64, timeout time.Duration) (bool, error)

func (*Client) FreqTryLock

func (p *Client) FreqTryLock(key string, limit int64, timeout time.Duration) (time.Duration, error)

func (*Client) Get

func (p *Client) Get(key string) (string, error)

func (*Client) GetFloat64

func (p *Client) GetFloat64(key string) (float64, error)

func (*Client) GetInt64

func (p *Client) GetInt64(key string) (int64, error)

func (*Client) GetJson

func (p *Client) GetJson(key string, j interface{}) error

func (*Client) GetUint64

func (p *Client) GetUint64(key string) (uint64, error)

func (*Client) HDecr

func (p *Client) HDecr(key string, field string) (int64, error)

func (*Client) HDecrBy

func (p *Client) HDecrBy(key string, field string, increment int64) (int64, error)

func (*Client) HDel

func (p *Client) HDel(key string, fields ...string) (int64, error)

func (*Client) HExists

func (p *Client) HExists(key, field string) (bool, error)

func (*Client) HGet

func (p *Client) HGet(key, field string) (string, error)

func (*Client) HGetAll

func (p *Client) HGetAll(key string) (map[string]string, error)

func (*Client) HGetJson

func (p *Client) HGetJson(key, field string, j interface{}) error

func (*Client) HIncr

func (p *Client) HIncr(key string, subKey string) (int64, error)

func (*Client) HIncrBy

func (p *Client) HIncrBy(key string, field string, increment int64) (int64, error)

func (*Client) HIncrByFloat

func (p *Client) HIncrByFloat(key string, field string, increment float64) (float64, error)

func (*Client) HKeys

func (p *Client) HKeys(key string) ([]string, error)

func (*Client) HSet

func (p *Client) HSet(key string, field string, value interface{}) (bool, error)

func (*Client) HVals

func (p *Client) HVals(key string) ([]string, error)

func (*Client) Incr

func (p *Client) Incr(key string) (int64, error)

func (*Client) IncrBy

func (p *Client) IncrBy(key string, value int64) (int64, error)

func (*Client) IncrByFloat

func (p *Client) IncrByFloat(key string, increment float64) (float64, error)

func (*Client) SAdd

func (p *Client) SAdd(key string, members ...string) (int64, error)

func (*Client) SISMember

func (p *Client) SISMember(key, field string) (bool, error)

func (*Client) SMembers

func (p *Client) SMembers(key string) ([]string, error)

func (*Client) SPop

func (p *Client) SPop(key string) (string, error)

func (*Client) SRandMember

func (p *Client) SRandMember(key string, count ...int64) ([]string, error)

func (*Client) SRem

func (p *Client) SRem(key string, members ...string) (int64, error)

func (*Client) Set

func (p *Client) Set(key string, value interface{}) (bool, error)

func (*Client) SetEx

func (p *Client) SetEx(key string, value interface{}, timeout time.Duration) (bool, error)

func (*Client) SetNx

func (p *Client) SetNx(key string, value interface{}) (bool, error)

func (*Client) SetNxWithTimeout

func (p *Client) SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error)

func (*Client) Ttl

func (p *Client) Ttl(key string) (time.Duration, error)

type Config

type Config struct {
	Address  string `json:"address,omitempty" yaml:"address,omitempty"`
	Database int    `json:"database,omitempty" yaml:"database,omitempty"`
	Password string `json:"password,omitempty" yaml:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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