rabbitmq

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContentTypes = []string{
	"text/plain",
	"application/json",
	"text/html",
	"text/xml",
}

ContentTypes is content type of messages

Functions

func SetContentType

func SetContentType(val uint8)

SetContentType is to set default ContentType

Types

type RM

type RM struct {
	DB *amqp.Connection
	Ch *amqp.Channel
}

RM is struct of RabitMQ object

func New

func New(host, user, pass string, port int) *RM

New is to connect to RabbitMQ server

func (*RM) Close

func (r *RM) Close()

Close is to close connection

func (*RM) CloseChannel

func (r *RM) CloseChannel()

CloseChannel is to close connection to channel

func (*RM) CreateChannel

func (r *RM) CreateChannel()

CreateChannel is to create channel

func (*RM) CreateConsume

func (r *RM) CreateConsume(name string, chBody chan []byte) (<-chan amqp.Delivery, error)

CreateConsume is to create Consume

func (*RM) CreateReceiver

func (r *RM) CreateReceiver(name string, chBody chan []byte)

CreateReceiver is for consumer

func (*RM) Declare

func (r *RM) Declare(name string) *amqp.Queue

Declare is to declare of queue name

func (*RM) Send

func (r *RM) Send(body []byte, q *amqp.Queue)

Send is for producer

Jump to

Keyboard shortcuts

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