Documentation ¶ Index ¶ type MqCallback type RedisMq func NewRedisMq(redisOption *redis.Options, prefix string, group string) *RedisMq func (t *RedisMq) Add(channel string, dataPtr any) error func (t *RedisMq) Clean() error func (t *RedisMq) On(channel string, cb MqCallback, dataPtr any) error func (t *RedisMq) Start() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type MqCallback ¶ type MqCallback func(id string, data any) 回调函数 type RedisMq ¶ type RedisMq struct { Prefix string Group string Streams []string Consumer string // contains filtered or unexported fields } func NewRedisMq ¶ func NewRedisMq(redisOption *redis.Options, prefix string, group string) *RedisMq 创建新消息队列客户端 func (*RedisMq) Add ¶ func (t *RedisMq) Add(channel string, dataPtr any) error data 会被 json 序列化 func (*RedisMq) Clean ¶ func (t *RedisMq) Clean() error 清理已消费的消息 master 节点定期调用 func (*RedisMq) On ¶ func (t *RedisMq) On(channel string, cb MqCallback, dataPtr any) error func (*RedisMq) Start ¶ func (t *RedisMq) Start() 启动服务 Source Files ¶ View all Source files redismq.go Click to show internal directories. Click to hide internal directories.