redis

package
v0.0.0-...-8dea7e7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Pool             *redis.Client
	RedisHost        string `conf:"env"`
	RedisPort        int    `conf:"env"`
	RedisPassword    string `conf:"env"`
	RedisDb          int    `conf:"env"`
	RedisExpireTime  int    `conf:"env"`
	PoolSize         int    `conf:"env"`
	KeyCount         int    `conf:"env"` // 单次获取的最大key数量
	PipelineWaitTime int    `conf:"env"` // pipeline 等待时间 单位秒
}

func (*Agent) CheckKeyExist

func (agent *Agent) CheckKeyExist(key string) (exist int64, err error)

1 exist 0 not exist

func (*Agent) Del

func (agent *Agent) Del(key string) (err error)

func (*Agent) Get

func (agent *Agent) Get(key string) (value []byte, err error)

func (*Agent) GetKeyList

func (agent *Agent) GetKeyList(key string) (keys []string, err error)

func (*Agent) InitPool

func (agent *Agent) InitPool() *redis.Client

func (*Agent) MGet

func (agent *Agent) MGet(key ...string) (values []interface{}, err error)

func (*Agent) Publish

func (agent *Agent) Publish(channel string, message string) (err error)

func (*Agent) Set

func (agent *Agent) Set(key string, value []byte, expire int) (err error)

func (*Agent) Subscribe

func (agent *Agent) Subscribe(channel string) *redis.PubSub

Jump to

Keyboard shortcuts

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