rabbitmq

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_MAXX_RECONNECT_TIMES = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerConfig added in v0.2.0

type ConsumerConfig struct {
	Queue     string
	Consumer  string
	AutoAck   bool
	Exclusive bool
	NoLocal   bool
	NoWait    bool
	Args      amqp.Table
}

type Message

type Message struct {
	Data        []byte
	ContentType string
}

type ProducerConfig added in v0.2.0

type ProducerConfig struct {
	Exchange  string
	Key       string
	Mandatory bool
	Immediate bool
}

type RabbitInterface

type RabbitInterface interface {
	Connect() (RabbitInterface, error)
	GetConnect() *rbm_pool
	SimpleQueueDeclare(sq SimpleQueue) (queue amqp.Queue, err error)
	Producer(ctx context.Context, pc *ProducerConfig, msg *Message) error
	Consumer(cc *ConsumerConfig, callback func(msg *amqp.Delivery))
	StartConsumer(cc *ConsumerConfig, callback func(msg *amqp.Delivery))
}

func New added in v0.1.1

func New(conf *config.Config) RabbitInterface

type SimpleQueue added in v0.2.0

type SimpleQueue struct {
	Name       string     // name
	Durable    bool       // durable
	AutoDelete bool       // delete when unused
	Exclusive  bool       // exclusive
	NoWait     bool       // no-wait
	Arguments  amqp.Table // arguments
}

Jump to

Keyboard shortcuts

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