redisutil

package
v0.0.0-...-b15094b Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

redisclient

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	Address string
	// contains filtered or unexported fields
}

func GetRedisClient

func GetRedisClient(address string) *RedisClient

获取指定Address的RedisClient

func (*RedisClient) BRPop

func (rc *RedisClient) BRPop(key string) (string, error)

删除,并获得该列表中的最后一个元素,或阻塞,直到有一个可用

func (*RedisClient) DECR

func (rc *RedisClient) DECR(key string) (int, error)

对存储在指定key的数值执行原子的减1操作

func (*RedisClient) Del

func (rc *RedisClient) Del(key string) (int64, error)

删除指定key

func (*RedisClient) Exists

func (rc *RedisClient) Exists(key string) (bool, error)

检查指定key是否存在

func (*RedisClient) Expire

func (rc *RedisClient) Expire(key string, timeOutSeconds int64) (int64, error)

设置指定key的过期时间

func (*RedisClient) FlushDB

func (rc *RedisClient) FlushDB()

删除当前数据库里面的所有数据 这个命令永远不会出现失败

func (*RedisClient) Get

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

获取指定key的内容, string

func (*RedisClient) GetObj

func (rc *RedisClient) GetObj(key string) (interface{}, error)

获取指定key的内容, interface{}

func (*RedisClient) HGet

func (rc *RedisClient) HGet(hashID string, field string) (string, error)

获取指定hashset的内容

func (*RedisClient) HGetAll

func (rc *RedisClient) HGetAll(hashID string) (map[string]string, error)

获取指定hashset的所有内容

func (*RedisClient) HSet

func (rc *RedisClient) HSet(hashID string, field string, val string) error

设置指定hashset的内容

func (*RedisClient) INCR

func (rc *RedisClient) INCR(key string) (int, error)

对存储在指定key的数值执行原子的加1操作

func (*RedisClient) LPush

func (rc *RedisClient) LPush(key string, val string) (int64, error)

将所有指定的值插入到存于 key 的列表的头部

func (*RedisClient) Set

func (rc *RedisClient) Set(key string, val interface{}) (interface{}, error)

func (*RedisClient) SetWithExpire

func (rc *RedisClient) SetWithExpire(key string, val interface{}, timeOutSeconds int64) (interface{}, error)

设置指定key的内容

Jump to

Keyboard shortcuts

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