msg

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 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 HandlerFunc

type HandlerFunc func(message *Message) error

func (HandlerFunc) HandlerMessage

func (h HandlerFunc) HandlerMessage(message *Message) error

HandleMessage implements the Handler interface

type Message

type Message struct {
	*nsq.Message
}

type Msg

type Msg interface {
	NewProducer() Msg                                 // new producer
	NewConsumer(topic, channel string) Msg            // new consumer
	Pub(topic string, msg interface{}) error          // pub interface{} message
	MultiPub(topic string, msgs ...interface{}) error // MultiPub ...interface{} message
	Sub(handler HandlerFunc) error                    // sub func to handle your work
}

message platform

func NewConsumer

func NewConsumer(topic, channel string, params ...interface{}) (msg Msg)

new consumer

func NewProducer

func NewProducer(params ...interface{}) (msg Msg)

new producer

type Nsg

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

nsq

func (*Nsg) MultiPub

func (n *Nsg) MultiPub(topic string, msgs ...interface{}) error

func (*Nsg) NewConsumer

func (n *Nsg) NewConsumer(topic, channel string) Msg

func (*Nsg) NewProducer

func (n *Nsg) NewProducer() Msg

func (*Nsg) Pub

func (n *Nsg) Pub(topic string, msg interface{}) error

func (*Nsg) Sub

func (n *Nsg) Sub(handler HandlerFunc) error

Jump to

Keyboard shortcuts

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