mq

package
v0.0.0-...-9b971e3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(customers []Consumer)

初始化消息队列

func Publish

func Publish(topic string, message interface{}) error

Publish 发布消息

Types

type BaseConsumer

type BaseConsumer struct{}

consumer基础实现

func (*BaseConsumer) InitCtx

func (c *BaseConsumer) InitCtx() context.Context

InitCtx 初始化context

func (*BaseConsumer) ParseMessage

func (c *BaseConsumer) ParseMessage(message *nsq.Message, dist interface{}) error

ParseMessage 解析消息内容

type Consumer

type Consumer struct {
	Topic   string
	Channel string
	Handler nsq.Handler
}

Customer 消费对象定义

Jump to

Keyboard shortcuts

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