redis

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*redis.Options)

Option 配置项方法

func Addr

func Addr(addr string) Option

Addr 地址配置项

func DB

func DB(db int) Option

DB 数据库配置项

func PoolSize

func PoolSize(size int) Option

PoolSize 池大小配置项

func Pwd

func Pwd(pwd string) Option

Pwd 密码配置项

type RdClient

type RdClient struct {
	*redis.Client
	// contains filtered or unexported fields
}

RdClient redis客户端类

func New

func New(options ...Option) *RdClient

New 构造函数

func (*RdClient) BRPop

func (r *RdClient) BRPop(timeout time.Duration, keys ...string) []string

func (*RdClient) Del

func (r *RdClient) Del(key string) bool

func (*RdClient) Exists

func (r *RdClient) Exists(key string) bool

func (*RdClient) Expire

func (r *RdClient) Expire(key string, expiration time.Duration) bool

func (*RdClient) Get

func (r *RdClient) Get(key string) string

func (*RdClient) HGet

func (r *RdClient) HGet(key, field string) string

func (*RdClient) HSet

func (r *RdClient) HSet(key, field string, val interface{}) bool

func (*RdClient) HSetNX

func (r *RdClient) HSetNX(key, field string, val interface{}) bool

func (*RdClient) IncrInt

func (r *RdClient) IncrInt(key string) int64

func (*RdClient) IncrStr

func (r *RdClient) IncrStr(key string) string

func (*RdClient) Keys

func (r *RdClient) Keys(pattern string) []string

func (*RdClient) LPush

func (r *RdClient) LPush(key string, val interface{}) bool

func (*RdClient) LRange

func (r *RdClient) LRange(key string, start int64, stop int64) []string

func (*RdClient) Publish

func (r *RdClient) Publish(channel string, msg interface{}) bool

func (*RdClient) Set

func (r *RdClient) Set(key string, val interface{}, expiration time.Duration) bool

func (*RdClient) SetNX

func (r *RdClient) SetNX(key string, val interface{}, expiration time.Duration) bool

func (*RdClient) SexEX

func (r *RdClient) SexEX(key string, val interface{}, expiration time.Duration) bool

func (*RdClient) TTL

func (r *RdClient) TTL(key string) float64

Jump to

Keyboard shortcuts

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