rabbitmq

package module
v0.0.0-...-669863a Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

README

rabbitmq

rabbitmq client based on amqp

Documentation

Index

Constants

View Source
const (
	TYPE_REPLY  = "REPLY"
	TYPE_SIMPLE = "SIMPLE"
)

Variables

This section is empty.

Functions

func NewTlsConfig

func NewTlsConfig(caFile, certFile, keyFile, keyFilePassword string) *tls.Config

Types

type Client

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

func NewClient

func NewClient(cfg *Config) *Client

func (*Client) AddMessageConsumer

func (c *Client) AddMessageConsumer(consumer func(msg amqp.Delivery))

func (*Client) AddReplyConsumer

func (c *Client) AddReplyConsumer(consumer func(msg amqp.Delivery))

func (*Client) GetQueueName

func (c *Client) GetQueueName() string

func (*Client) Publish

func (c *Client) Publish(exchange, routeKey string,
	msg amqp.Publishing, confirm bool) (err error)

func (*Client) Start

func (c *Client) Start() (err error)

type Config

type Config struct {
	HostPort            string
	Username            string
	Password            string
	Prefetch            int
	Exchanges           []Exchange
	QueuePrefix         string
	QueueName           string
	QueueAutoDelete     bool
	QueueEnable         bool
	UseTls              bool
	ReplyConfirmTimeout time.Duration
	Amqp                amqp.Config
}

func NewConfig

func NewConfig() *Config

type Confirm

type Confirm struct {
	NeedConfirm bool
	ReplyTo     []string
	Timeout     time.Duration
}

type Exchange

type Exchange struct {
	Name string
	Kind string
}

Jump to

Keyboard shortcuts

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