gredis

package
v0.0.0-...-6e78f20 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global_redis = &RedisDb{}

Functions

func Setup

func Setup() bool

redis设置

Types

type RedisDb

type RedisDb struct {
}

func (*RedisDb) Close

func (this *RedisDb) Close() error

Close

func (*RedisDb) Get

func (this *RedisDb) Get(key string) *redis.StringCmd

get

func (*RedisDb) HDel

func (this *RedisDb) HDel(key string, fields ...string) *redis.IntCmd

HDel 某个的hash表的删除某些字段

func (*RedisDb) HGet

func (this *RedisDb) HGet(key string, field string) *redis.StringCmd

HGet 某个的hash表的字段获取

func (*RedisDb) HSet

func (this *RedisDb) HSet(key string, field string, value interface{}) *redis.BoolCmd

HSet 某个的hash表的字段设置

func (*RedisDb) Ping

func (this *RedisDb) Ping() *redis.StatusCmd

Ping 检测链接是否正常 一段时间后redis操作前,需要调用一下Ping(), 如果已经发生断开,会自动先触发重连,避免后继操作出错

func (*RedisDb) Publish

func (this *RedisDb) Publish(channel string, message interface{}) *redis.IntCmd

发布

func (*RedisDb) Set

func (this *RedisDb) Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd

set

func (*RedisDb) Subscribe

func (this *RedisDb) Subscribe(channels ...string) *redis.PubSub

订阅

Jump to

Keyboard shortcuts

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