rabitmq

package
v0.0.0-...-9966579 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRabbitMqProducer

func NewRabbitMqProducer() *rabbitMqProducer

Types

type ExchangeOption

type ExchangeOption struct {
	Name       string
	Type       string
	Durable    bool
	AutoDelete bool
	Arguments  map[string]interface{}
}

type MqBus

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

bus

func NewMqEventBus

func NewMqEventBus() *MqBus

func (*MqBus) PublishDirect

func (bus *MqBus) PublishDirect(obj interface{}, exchangeOpt ExchangeOption, queueOpt QueueOption, expire int) error

func (*MqBus) PublishFanout

func (bus *MqBus) PublishFanout(obj interface{}, exchangeOpt ExchangeOption) error

func (MqBus) SubscribeDirect

func (bus MqBus) SubscribeDirect(exchangeOpt ExchangeOption, queueOpt QueueOption, f func([]byte) bool)

func (*MqBus) SubscribeFanout

func (bus *MqBus) SubscribeFanout(queueName string, exchangeOpt ExchangeOption, f func([]byte))

type QueueOption

type QueueOption struct {
	Name       string
	RoutingKey string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	Arguments  map[string]interface{}
}

type RabbitMqConnPool

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

func NewRabbitMqConnPool

func NewRabbitMqConnPool() *RabbitMqConnPool

func (*RabbitMqConnPool) Free

func (p *RabbitMqConnPool) Free(conn *amqp.Connection) error

func (*RabbitMqConnPool) GetFreeRabbitMqConn

func (p *RabbitMqConnPool) GetFreeRabbitMqConn(timeout time.Duration) (*amqp.Connection, error)

type RabbitMqConsumer

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

func (RabbitMqConsumer) SubscribeDirect

func (bus RabbitMqConsumer) SubscribeDirect(exchangeOpt ExchangeOption, queueOpt QueueOption, f func([]byte) bool)

func (*RabbitMqConsumer) SubscribeFanout

func (bus *RabbitMqConsumer) SubscribeFanout(queueName string, exchangeOpt ExchangeOption, f func([]byte)) error

func (*RabbitMqConsumer) SubscribeFanoutEx

func (bus *RabbitMqConsumer) SubscribeFanoutEx(queueName string, exchangeOpt ExchangeOption, f func([]byte))

Jump to

Keyboard shortcuts

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