mqx

package
v0.0.0-...-7c465ed Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(nsqdAdrs []string, customers []Consumer)

初始化消息队列

func Publish

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

Publish 发布消息

func PublishWithBytes

func PublishWithBytes(topic string, msg []byte) error

通过字节流发送消息

Types

type BaseConsumer

type BaseConsumer struct{}

consumer基础实现

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 消费对象定义

type MqConfig

type MqConfig struct {
	Nsqds []string `mapstructure:"nsqds"`
}

Jump to

Keyboard shortcuts

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