myredis

package
v0.0.0-...-d74cc4e Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	Pool *redis.Pool
	// contains filtered or unexported fields
}

RedisClient Redis客户端

func NewClient

func NewClient() *RedisClient

NewClient 新建redis客户端连接

func (*RedisClient) Close

func (r *RedisClient) Close()

Close 关闭

func (*RedisClient) DEL

func (r *RedisClient) DEL(key string) (int, error)

DEL 删除key

func (*RedisClient) EXPIRE

func (r *RedisClient) EXPIRE(key string, sec int64) (int64, error)

EXPIRE 设置key的过期时间

func (*RedisClient) GET

func (r *RedisClient) GET(key string) (string, error)

GET 获取hash中key对应的数据

func (*RedisClient) HGET

func (r *RedisClient) HGET(key string, field string) (string, error)

HGET 获取hash中key对应的field的数据

func (*RedisClient) HGETALL

func (r *RedisClient) HGETALL(key string) (map[string]string, error)

HGETALL 获取key对应的hash数据

func (*RedisClient) HSET

func (r *RedisClient) HSET(key string, field string, value string) (int64, error)

HSET 设置hash中key对应的field的数据

func (*RedisClient) KEYS

func (r *RedisClient) KEYS(patten string) ([]string, error)

KEYS 检索规则匹配的key

func (*RedisClient) NewPool

func (r *RedisClient) NewPool(opts config.RedisConnOpt)

NewPool 新建Redis线程池

func (*RedisClient) SET

func (r *RedisClient) SET(key string, value string) (int64, error)

SET 设置key对应的数据

func (*RedisClient) SETEX

func (r *RedisClient) SETEX(key string, sec int, value string) (int64, error)

SETEX 设置key对应的数据

func (*RedisClient) Start

func (r *RedisClient) Start()

Start 开始监听数据

func (*RedisClient) Write

func (r *RedisClient) Write(data StoreData)

Write 向redis中写入数据

func (*RedisClient) WriteHash

func (r *RedisClient) WriteHash(key string, value map[string]string)

WriteHash 向redis中写入多组数据

func (*RedisClient) Writes

func (r *RedisClient) Writes(data []StoreData)

Writes 向redis中写入多组数据

type StoreData

type StoreData struct {
	Key    string
	Field  string
	Value  string
	Expire int64
}

StoreData 存储的数据结构

Jump to

Keyboard shortcuts

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