mq

package
v0.0.0-...-4c3b4b8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBroker

type IBroker interface {
	Connect(url string) error
	Close() error
	Publish(topic string, v any) error
	Subscribe(topic string, handler MessageHandler) error
	OpenChannel(name string) (IChannel, error)
}

type IChannel

type IChannel interface {
	Close() error
	Publish(topic string, v any) error
	Subscribe(topic string, handler MessageHandler) error
}

type IMessage

type IMessage interface {
	//Acknowledge consumed message	/ 确认消费该消息
	Ack() error
	//Requeued to be consumed again / 重新排队并再次消费
	Requeue() error
	//Reject to consume again / 拒绝再次消费
	Reject() error
	//Unmarshal To target
	Unmarshal(v any) error
	//MIME content type
	ContentType() string
	// Body raw data
	Body() []byte
	//Message ID
	ID() string
}

type MessageHandler

type MessageHandler func(IMessage)

Jump to

Keyboard shortcuts

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