redis

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var REDIS_CMD_AUTH = "AUTH"
View Source
var REDIS_CMD_BRPOP = "BRPOP"
View Source
var REDIS_CMD_DEL = "DEL"
View Source
var REDIS_CMD_EVAL = "EVAL"
View Source
var REDIS_CMD_EXPIRE = "EXPIRE"
View Source
var REDIS_CMD_GET = "GET"
View Source
var REDIS_CMD_LPUSH = "LPUSH"
View Source
var REDIS_CMD_PING = "PING"
View Source
var REDIS_CMD_PSUBSCRIBE = "PSUBSCRIBE" //模式订阅(使用*作为通配符)
View Source
var REDIS_CMD_PUBLISH = "PUBLISH"
View Source
var REDIS_CMD_SET = "SET"
View Source
var REDIS_CMD_SUBSCRIBE = "SUBSCRIBE"
View Source
var REDIS_RESP_OK = "OK"
View Source
var REDIS_SET_EX = "EX"
View Source
var REDIS_SET_NX = "NX"
View Source
var REDIS_SET_WITH_EXPIRE_TIME = "PX"

Functions

func NewMQ

func NewMQ() mq.IReactMQ

Types

type RedisMQ

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

func (*RedisMQ) Close added in v1.0.9

func (this *RedisMQ) Close()

func (*RedisMQ) Connect

func (this *RedisMQ) Connect(mode mq.Mode, strURL string) (err error)

Redis连接URL 有密码 "redis://123456@192.168.1.10:6379"

没有密码则是 "redis://192.168.1.10:6379"

func (*RedisMQ) Consume

func (this *RedisMQ) Consume(strBindingKey, strQueueName string, handler mq.ReactHandler) (err error)

* @brief 消息消费接口定义 * @param strBindingKey 队列绑定Key * @param strQueueName 队列名称 * @param handler 消费回调处理对象 * @return err 成功返回nil,失败返回返回具体错误信息 * @remark 服务器异常或重启时内部会自动重连服务器

func (*RedisMQ) Debug

func (this *RedisMQ) Debug(enable bool)

* @brief 开启或关闭调式模式 * @param enable true开启/false关闭

func (*RedisMQ) GetAdapter added in v1.0.9

func (this *RedisMQ) GetAdapter() (adapter mq.Adapter)

* @brief 获取当前MQ类型 * @param adapter MQ类型

func (*RedisMQ) IsClosed

func (this *RedisMQ) IsClosed() bool

func (*RedisMQ) Publish

func (this *RedisMQ) Publish(strBindingKey, strQueueName, key string, value string) (err error)

* @brief 消息发布接口定义(仅支持字符串类型消息) * @param strBindingKey 队列绑定Key(topic) * @param strQueueName 队列名称(group) * @param key 消息KEY(仅kafka必填,其他MQ类型默认填PRODUCER_KEY_NULL) * @param value 消息数据 * @return err 发布失败返回具体错误信息

func (*RedisMQ) Reconnect

func (this *RedisMQ) Reconnect() (err error)

Jump to

Keyboard shortcuts

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