redis

package
v0.0.0-...-b639fcc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitPool

func InitPool()

初始化Redis连接池

Types

type Client

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

redis 连接

func Init

func Init() *Client

初始化redis服务 初始化redis连接池,返回redis存储客户端

func (*Client) Close

func (client *Client) Close()

关闭连接

func (*Client) Exists

func (client *Client) Exists(key string) bool

检查key是否存在 key: 键值

func (*Client) Load

func (client *Client) Load(key string, dest interface{})

获取hash数据 key: 键值 dest: 解析hash到指定结构体

func (*Client) LoadField

func (client *Client) LoadField(key string, field string) (result string)

获取hash中一项的数据

func (*Client) Open

func (client *Client) Open()

从连接池中获取一个redis 连接

func (*Client) ReadString

func (client *Client) ReadString(key string) (string string, err error)

读取字符串数据

func (*Client) Save

func (client *Client) Save(key string, s interface{})

写入hash数据 key: 键值 s: 结构体

func (*Client) SaveField

func (client *Client) SaveField(key string, field string, val interface{})

写入hash 中 某一项数据

func (*Client) WriteString

func (client *Client) WriteString(key string, val string)

写入字符串

Jump to

Keyboard shortcuts

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