rabbitmq

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client *client
)

Functions

func InitRabbitMq

func InitRabbitMq(rabbitMqName string, confStr string) error

func InitRabbitMqWithConfig added in v0.2.10

func InitRabbitMqWithConfig(rabbitMqName string, conf *Config) error

Types

type Config

type Config struct {
	Host     string `json:"host" yaml:"host" validate:"required"`
	Username string `json:"username" yaml:"username" validate:"required"`
	Password string `json:"password" yaml:"password" validate:"required"`
	Vhosts   string `json:"vhosts" yaml:"vhosts" validate:"required"`
}

type ConsumeParams

type ConsumeParams struct {
	QueueName    string
	ConsumerName string
	AutoAck      bool
	Exclusive    bool
	NoLocal      bool
	NoWait       bool
	Args         amqp.Table
}

type Consumer

type Consumer func(msg amqp.Delivery) error

type QueueBindParams

type QueueBindParams struct {
	QueueName    string
	RoutingKey   string
	ExchangeName string
	NoWait       bool
	Args         amqp.Table
}

type QueueDeclareParams

type QueueDeclareParams struct {
	Queue      string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
	Args       amqp.Table
}

type RabbitMQConsumer

type RabbitMQConsumer struct {
	ErrChan chan error
	// contains filtered or unexported fields
}

func NewRabbitMQConsumer

func NewRabbitMQConsumer(workSize int64, rabbitModel string,
	queueDeclareParams *QueueDeclareParams, consumeParams *ConsumeParams, queueBindParams ...*QueueBindParams) *RabbitMQConsumer

func (*RabbitMQConsumer) Working

func (f *RabbitMQConsumer) Working(consumer Consumer) (err error)

Jump to

Keyboard shortcuts

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