redis

package
v0.0.0-...-532f4bb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 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 Redigo

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

func InitRedis

func InitRedis(conf *RedisConfig) (*Redigo, error)

func (*Redigo) Del

func (hy *Redigo) Del(keys ...string) error

func (*Redigo) Exists

func (hy *Redigo) Exists(key string) (bool, error)

func (*Redigo) Expire

func (hy *Redigo) Expire(key string, seconds int) (bool, error)

func (*Redigo) Get

func (hy *Redigo) Get(key string) (string, error)

func (*Redigo) GetConn

func (hy *Redigo) GetConn() redis.Conn

func (*Redigo) HGet

func (hy *Redigo) HGet(key string, field string) (string, error)

func (*Redigo) HGetAll

func (hy *Redigo) HGetAll(key string) (map[string]string, error)

func (*Redigo) HMGet

func (hy *Redigo) HMGet(key string, fields ...string) ([]string, error)

func (*Redigo) HMSet

func (hy *Redigo) HMSet(key string, fieldValues map[string]string) error

func (*Redigo) HSet

func (hy *Redigo) HSet(key string, field string, value string) error

func (*Redigo) Incr

func (hy *Redigo) Incr(key string) (int, error)

func (*Redigo) IncrBy

func (hy *Redigo) IncrBy(key string, incr int) (int, error)

func (*Redigo) MGet

func (hy *Redigo) MGet(keys ...string) ([]string, error)

func (*Redigo) MSet

func (hy *Redigo) MSet(keyValues map[string]string) error

func (*Redigo) SAdd

func (hy *Redigo) SAdd(key string, members ...string) error

func (*Redigo) SIsMember

func (hy *Redigo) SIsMember(key string, member string) (bool, error)

func (*Redigo) SMembers

func (hy *Redigo) SMembers(key string) ([]string, error)

func (*Redigo) SRem

func (hy *Redigo) SRem(key string, members ...string) error

func (*Redigo) Set

func (hy *Redigo) Set(key string, value string) error

func (*Redigo) SetEx

func (hy *Redigo) SetEx(key string, value string, seconds int) error

func (*Redigo) SetNx

func (hy *Redigo) SetNx(key string, value string) (bool, error)

func (*Redigo) ZAdd

func (hy *Redigo) ZAdd(key string, values map[string]int) error

func (*Redigo) ZRange

func (hy *Redigo) ZRange(key string, start, end int) ([]string, error)

func (*Redigo) ZRangeByScore

func (hy *Redigo) ZRangeByScore(key string, min, max interface{}) ([]string, error)

func (*Redigo) ZRangeByScoreWithScores

func (hy *Redigo) ZRangeByScoreWithScores(key string, min, max interface{}) (map[string]int, error)

func (*Redigo) ZRangeWithScores

func (hy *Redigo) ZRangeWithScores(key string, start, end int) (map[string]int, error)

func (*Redigo) ZRem

func (hy *Redigo) ZRem(key string, members ...string) error

func (*Redigo) ZScore

func (hy *Redigo) ZScore(key string, member string) (int, error)

type RedisConfig

type RedisConfig struct {
	Addrs        string
	Password     string
	MaxIdleConns int //最初的连接数量
	MaxOpenConns int //连接池最大连接数量,不确定可以用0(0表示自动定义,按需分配)
	MaxLifeTime  int //连接关闭时间100秒(100秒不使用将关闭)
}

Jump to

Keyboard shortcuts

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