rabbitmq

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExchangeTypeDirect  = "direct"
	ExchangeTypeFanout  = "fanout"
	ExchangeTypeTopic   = "topic"
	ExchangeTypeHeaders = "headers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName  string
	Host         string
	Port         int
	Virtual      string
	User         string
	Pass         string
	ExchangeType string
	ExchangeName string
	QueueName    string
	RouteName    string
}

type Option

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

type OptionFunc

type OptionFunc func(*Option)

func WithBindQueue

func WithBindQueue(turn bool) OptionFunc

func WithDeclareExchange

func WithDeclareExchange(turn bool) OptionFunc

func WithDeclareQueue

func WithDeclareQueue(turn bool) OptionFunc

func WithQos

func WithQos(qos int) OptionFunc

type RabbitMQ

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

func New

func New(cfg *Config, opts ...OptionFunc) (*RabbitMQ, error)

func (*RabbitMQ) Consume

func (q *RabbitMQ) Consume(consumer queue.Consumer)

func (*RabbitMQ) Produce

func (q *RabbitMQ) Produce(ctx context.Context, msg interface{}, opts ...queue.ProduceOptionFunc) (err error)

func (*RabbitMQ) Shutdown

func (q *RabbitMQ) Shutdown() (err error)

Jump to

Keyboard shortcuts

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