redis

package module
v0.0.0-...-32eaf10 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package redis Date: 2022/9/23 00:51 Author: Amu Description:

Package redis Date: 2023/12/4 13:59 Author: Amu Description:

Package redis Date: 2023/12/4 14:01 Author: Amu Description:

Package redis Date: 2023/12/4 14:00 Author: Amu Description:

Package redis Date: 2023/12/4 12:12 Author: Amu Description:

Package redis Date: 2023/12/4 14:01 Author: Amu Description:

Package redis Date: 2023/12/4 14:00 Author: Amu Description:

Package redis Date: 2023/12/4 14:01 Author: Amu Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	redis.UniversalClient
}

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (*Client) Append

func (rc *Client) Append(key string, appendString string) (int64, error)

func (*Client) Close

func (rc *Client) Close()

func (*Client) DBSize

func (rc *Client) DBSize() (int64, error)

func (*Client) Decr

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

func (*Client) DecrBy

func (rc *Client) DecrBy(key string, step int64) (int64, error)

func (*Client) Delete

func (rc *Client) Delete(keys ...string) (int64, error)

func (*Client) Exists

func (rc *Client) Exists(key string) (int64, error)

func (*Client) Expire

func (rc *Client) Expire(key string, expireDuration time.Duration) (bool, error)

func (*Client) ExpireAt

func (rc *Client) ExpireAt(key string, expireTime time.Time) (bool, error)

func (*Client) FlushAll

func (rc *Client) FlushAll() (string, error)

FlushAll 清空所有数据库

func (*Client) FlushDB

func (rc *Client) FlushDB() (string, error)

FlushDB 清空当前数据库

func (*Client) Get

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

func (*Client) GetRange

func (rc *Client) GetRange(key string, startIndex int64, endIndex int64) (string, error)

func (*Client) HDel

func (rc *Client) HDel(key string, field ...string) (int64, error)

func (*Client) HExists

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

func (*Client) HGet

func (rc *Client) HGet(key, field string) (interface{}, error)

func (*Client) HGetAll

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

func (*Client) HLen

func (rc *Client) HLen(key string) (int64, error)

func (*Client) HMset

func (rc *Client) HMset(key string, values map[string]interface{}) (bool, error)

func (*Client) Hset

func (rc *Client) Hset(key string, field1, value1 string, field2, value2 string) (int64, error)

func (*Client) Incr

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

func (*Client) IncrBy

func (rc *Client) IncrBy(key string, step int64) (int64, error)

func (*Client) Keys

func (rc *Client) Keys() ([]string, error)

func (*Client) LIndex

func (rc *Client) LIndex(key string, index int64) (string, error)

func (*Client) LInsert

func (rc *Client) LInsert(key string, location string, target interface{}, value interface{}) (int64, error)

LInsert 在第一个 target 的前或后插入新元素 value

func (*Client) LInsertAfter

func (rc *Client) LInsertAfter(key string, target interface{}, value interface{}) (int64, error)

func (*Client) LInsertBefore

func (rc *Client) LInsertBefore(key string, target interface{}, value interface{}) (int64, error)

func (*Client) LLen

func (rc *Client) LLen(key string) (int64, error)

func (*Client) LPop

func (rc *Client) LPop(key string) (string, error)

func (*Client) LPush

func (rc *Client) LPush(key string, values ...interface{}) (int64, error)

func (*Client) LRange

func (rc *Client) LRange(key string, start int64, end int64) ([]string, error)

func (*Client) LRem

func (rc *Client) LRem(key string, nums int64, value string) (int64, error)

LRem 删除指定数量 nums 的 value,返回实际删除的元素个数

func (*Client) LSet

func (rc *Client) LSet(key string, index int64, value interface{}) (string, error)

func (*Client) PTTL

func (rc *Client) PTTL(key string) (time.Duration, error)

func (*Client) RPop

func (rc *Client) RPop(key string) (string, error)

func (*Client) RPush

func (rc *Client) RPush(key string, values ...interface{}) (int64, error)

func (*Client) SAdd

func (rc *Client) SAdd(key string, values ...interface{}) (int64, error)

func (*Client) SCard

func (rc *Client) SCard(key string) (int64, error)

func (*Client) SDiff

func (rc *Client) SDiff(key1, key2 string) ([]string, error)

func (*Client) SInter

func (rc *Client) SInter(key1, key2 string) ([]string, error)

func (*Client) SIsMembers

func (rc *Client) SIsMembers(key string, value interface{}) (bool, error)

func (*Client) SMembers

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

func (*Client) SPop

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

SPop 随机获取一个元素,无序,随机

func (*Client) SRem

func (rc *Client) SRem(key string, values ...interface{}) (int64, error)

func (*Client) SUnion

func (rc *Client) SUnion(key1, key2 string) ([]string, error)

func (*Client) Set

func (rc *Client) Set(key, value string) (string, error)

func (*Client) SetEX

func (rc *Client) SetEX(key, value string, duration time.Duration) (string, error)

func (*Client) SetNX

func (rc *Client) SetNX(key, value string, duration time.Duration) (bool, error)

func (*Client) StrLen

func (rc *Client) StrLen(key string) (int64, error)

func (*Client) TTL

func (rc *Client) TTL(key string) (time.Duration, error)

func (*Client) Type

func (rc *Client) Type(key string) (string, error)

func (*Client) ZAdd

func (rc *Client) ZAdd(key string, member interface{}, score float64) (int64, error)

func (*Client) ZCard

func (rc *Client) ZCard(key string) (int64, error)

func (*Client) ZCount

func (rc *Client) ZCount(key string, minScore, maxScore string) (int64, error)

func (*Client) ZIncrBy

func (rc *Client) ZIncrBy(key string, member string, score float64) (float64, error)

ZIncrBy 增加 member 的分值,返回更新后的分值

func (*Client) ZRange

func (rc *Client) ZRange(key string, start int64, end int64) ([]string, error)

ZRange 获取根据 score 排序后的 [start, end] 元素

func (*Client) ZRangeByScore

func (rc *Client) ZRangeByScore(key string, minScore string, maxScore string) ([]string, error)

func (*Client) ZRank

func (rc *Client) ZRank(key string, value string) (int64, error)

func (*Client) ZRem

func (rc *Client) ZRem(key string, value string) (int64, error)

func (*Client) ZRemRangeByRank

func (rc *Client) ZRemRangeByRank(key string, startIndex, endIndex int64) (int64, error)

func (*Client) ZRemRangeByScore

func (rc *Client) ZRemRangeByScore(key string, minScore, maxScore string) (int64, error)

func (*Client) ZRevRange

func (rc *Client) ZRevRange(key string, start int64, end int64) ([]string, error)

func (*Client) ZRevRangeByScore

func (rc *Client) ZRevRangeByScore(key string, minScore string, maxScore string) ([]string, error)

func (*Client) ZRevRank

func (rc *Client) ZRevRank(key string, value string) (int64, error)

func (*Client) ZScore

func (rc *Client) ZScore(key string, score string) (float64, error)

type Option

type Option func(*option)

func WithAddrs

func WithAddrs(addrs []string) Option

func WithConnectionTimeout

func WithConnectionTimeout(connectionTimeout string) Option

func WithDB

func WithDB(db int) Option

func WithIdleTimeout

func WithIdleTimeout(idleTimeout string) Option

func WithMasterName

func WithMasterName(masterName string) Option

func WithPassword

func WithPassword(password string) Option

func WithPoolSize

func WithPoolSize(poolSize int) Option

func WithReadTimeout

func WithReadTimeout(readTimeout string) Option

func WithWriteTimeout

func WithWriteTimeout(writeTimeout string) Option

Jump to

Keyboard shortcuts

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