amqp

package
v0.3.5-0...-95db35b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyTopology

type ApplyTopology func(ch *amqp.Channel) error

ApplyTopology to apply resource from MQ server eg. QueueDeclare, ExchangeDeclare

type ConsumeHandler

type ConsumeHandler func(d amqp.Delivery) error

ConsumeHandler .

type Wrapper

type Wrapper struct {
	Addr   string
	Config amqp.Config
	// contains filtered or unexported fields
}

Wrapper .

func New

func New(addr string, cfg amqp.Config, f ApplyTopology) *Wrapper

New . addr schema://username:pwd@host:port

func (*Wrapper) Channel

func (w *Wrapper) Channel(timeout time.Duration) (*amqp.Channel, error)

Channel . it will blocked

func (*Wrapper) Close

func (w *Wrapper) Close() error

Close .

func (*Wrapper) Consume

func (w *Wrapper) Consume(
	queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table,
	handler ConsumeHandler,
)

Consume .

func (*Wrapper) Produce

func (w *Wrapper) Produce(exchange, key string, mandatory, immediate bool, dat []byte) error

Produce .

Jump to

Keyboard shortcuts

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