smq

package
v1.0.76 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRabbitMQ

func NewRabbitMQ(broker string, exchange Exchange) *rabbit

Types

type Client

type Client interface {
	Connect() error
	Pub(topic string, message []byte, option ...Option) error
	Sub(topic string, subscriber Subscriber) error
	Close() error
}

type Exchange

type Exchange struct {
	Type  string // 交换机类型
	Name  string // 交换机名称
	Key   string // key值
	Queue string // 队列名称
}

type Option

type Option func(ops *Options)

func Ack

func Ack(ack bool) Option

func TTL

func TTL(ttl time.Duration) Option

type Options

type Options struct {
	Ack bool
	TTL time.Duration
}

type Subscriber

type Subscriber func(client Client, topic string, message []byte, options Options) (err error)

Jump to

Keyboard shortcuts

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