redis

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MemoryStatsMetrics = []string{
	"peak.allocated",
	"total.allocated",
	"startup.allocated",
	"overhead.total",
	"keys.count",
	"dataset.bytes",
}

Functions

func GetRedisClient

func GetRedisClient() (c db.RedisClient, err error)

func NewRedisPool

func NewRedisPool() *redis.Pool

Types

type Client

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

func NewRedisClient

func NewRedisClient(opts ...Option) (client *Client, err error)

func (*Client) AllKeys

func (client *Client) AllKeys() (values []string, err error)

func (*Client) BLPop

func (client *Client) BLPop(collection string, timeout int) (value string, err error)

func (*Client) BRPop

func (client *Client) BRPop(collection string, timeout int) (value string, err error)

func (*Client) BZPopMax

func (client *Client) BZPopMax(collection string, timeout int) (value string, err error)

func (*Client) BZPopMin

func (client *Client) BZPopMin(collection string, timeout int) (value string, err error)

func (*Client) Del

func (client *Client) Del(collection string) error

func (*Client) Get

func (client *Client) Get(collection string) (value string, err error)

func (*Client) HDel

func (client *Client) HDel(collection string, key string) error

func (*Client) HGet

func (client *Client) HGet(collection string, key string) (string, error)

func (*Client) HKeys

func (client *Client) HKeys(collection string) (results []string, err error)

func (*Client) HScan

func (client *Client) HScan(collection string) (results map[string]string, err error)

func (*Client) HSet

func (client *Client) HSet(collection string, key string, value string) error

func (*Client) Keys

func (client *Client) Keys(pattern string) (values []string, err error)

func (*Client) LLen

func (client *Client) LLen(collection string) (int, error)

func (*Client) LPop

func (client *Client) LPop(collection string) (string, error)

func (*Client) LPush

func (client *Client) LPush(collection string, value interface{}) error

func (*Client) Lock

func (client *Client) Lock(lockKey string) (value int64, err error)

func (*Client) MemoryStats

func (client *Client) MemoryStats() (stats map[string]int64, err error)

func (*Client) Ping

func (client *Client) Ping() error

func (*Client) RPop

func (client *Client) RPop(collection string) (string, error)

func (*Client) RPush

func (client *Client) RPush(collection string, value interface{}) error

func (*Client) Set

func (client *Client) Set(collection string, value string) (err error)

func (*Client) SetBackoffMaxInterval

func (client *Client) SetBackoffMaxInterval(interval time.Duration)

func (*Client) SetTimeout

func (client *Client) SetTimeout(timeout int)

func (*Client) UnLock

func (client *Client) UnLock(lockKey string, value int64)

func (*Client) ZAdd

func (client *Client) ZAdd(collection string, score float32, value interface{}) (err error)

func (*Client) ZCount

func (client *Client) ZCount(collection string, min string, max string) (count int, err error)

func (*Client) ZCountAll

func (client *Client) ZCountAll(collection string) (count int, err error)

func (*Client) ZPopMax

func (client *Client) ZPopMax(collection string, count int) (results []string, err error)

func (*Client) ZPopMaxOne

func (client *Client) ZPopMaxOne(collection string) (value string, err error)

func (*Client) ZPopMin

func (client *Client) ZPopMin(collection string, count int) (results []string, err error)

func (*Client) ZPopMinOne

func (client *Client) ZPopMinOne(collection string) (value string, err error)

func (*Client) ZScan

func (client *Client) ZScan(collection string, pattern string, count int) (values []string, err error)

type Option

type Option func(c db.RedisClient)

func WithBackoffMaxInterval

func WithBackoffMaxInterval(interval time.Duration) Option

func WithTimeout

func WithTimeout(timeout int) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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