rabbitmq

package
v0.0.0-...-750a8a5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

@Description TODO @Author jiangyang @Created 2020/11/21 2:51 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Conn

func Conn() *amqp.Connection

func Consume

func Consume(queueName string, msgHandler func(amqp.Delivery)) error

消费者

func DirectPublish

func DirectPublish(excName string, key string, body []byte) error

func DirectSubscribe

func DirectSubscribe(excName string, queueName string, key string, msgHandle func(amqp.Delivery)) error

func FanoutPublish

func FanoutPublish(excName string, body []byte) error

func FanoutSubscribe

func FanoutSubscribe(excName string, queueName string, msgHandle func(amqp.Delivery)) error

func Init

func Init(cfg Config)

func Produce

func Produce(queueName string, body []byte) error

生产者

func TopicPublish

func TopicPublish(excName string, key string, body []byte) error

func TopicSubscribe

func TopicSubscribe(excName string, queueName string, key string, msgHandle func(amqp.Delivery)) error

Types

type Config

type Config struct {
	Addr      string `json:"addr"`
	QueueName string `json:"queue_name" mapstructure:"queue_name"`
}

Jump to

Keyboard shortcuts

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