rabbitmq

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenConsumeLog added in v1.0.7

func OpenConsumeLog() optionFunc

func WithLogger added in v1.0.7

func WithLogger(l logger.Logger) optionFunc

func WithQos

func WithQos(qos int) optionFunc

Types

type Client added in v1.0.7

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

func New

func New(config *Config, opts ...optionFunc) (cli *Client, err error)

func (*Client) Consume added in v1.0.7

func (cli *Client) Consume(params interface{}) (err error)

func (*Client) Produce added in v1.0.7

func (cli *Client) Produce(ctx context.Context, msg interface{}) (
	response queue.ProduceResponse, err error,
)

func (*Client) Shutdown added in v1.0.7

func (cli *Client) Shutdown() (err error)

type Config

type Config struct {
	ServiceName string
	Host        string
	Port        int
	Virtual     string
	User        string
	Pass        string
}

type ConsumeParams added in v1.0.7

type ConsumeParams struct {
	Context     context.Context
	Queue       string
	AutoAck     bool
	Exclusive   bool
	NoLocal     bool
	NoWait      bool
	Args        amqp.Table
	MultipleAck bool
	Consumer    queue.Consumer
}
params := ConsumeParams{
	queue:     "queue_name",
	AutoAck:   false,
	Exclusive: false,
	NoLocal:   false,
	NoWait:    false,
	Args:      nil,
	Consumer:  queue.Consumer,
}

type ProduceMessage added in v1.0.7

type ProduceMessage struct {
	Exchange  string // exchange
	Key       string // routing key
	Mandatory bool   // set true, when no queue match Basic.Return
	Immediate bool   // set false, not dependent consumers
	// amqp.Publishing{
	// 	DeliveryMode: amqp.Persistent,
	// 	ContentType:  "text/plain",
	// 	Body:         m,
	// })
	Message     amqp.Publishing
	OpenConfirm bool
}

Jump to

Keyboard shortcuts

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