rabbitmq

package
v0.0.0-...-50a54d8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailOnError

func FailOnError(err error, msg string)

FailOnError mq fail

Types

type Client

type Client struct {
	Conn   *amqp.Connection
	Chs    map[string]*amqp.Channel
	Queues map[string]amqp.Queue
	Tracer opentracing.Tracer
	Closer io.Closer
}

Client ..

func NewClient

func NewClient(config *config.RabbitmqConfig, queueNames []string) (*Client, error)

NewClient ..

func NewClientFromEtcd

func NewClientFromEtcd(etcdCli *etcd.Client, appName, profile string, queueNames []string) (mqCli *Client, err error)

NewClientFromEtcd init gorm from etcd config and watch config to update gorm

func (*Client) ConsumeMessage

func (c *Client) ConsumeMessage(ctx context.Context, msg *amqp.Delivery, f func())

func (*Client) PublishMessage

func (c *Client) PublishMessage(ctx context.Context, exhcange, key string, immediate bool, msg amqp.Publishing) error

PublishMessage ..

Jump to

Keyboard shortcuts

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