rabbitmq

package
v0.0.0-...-92f7cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypePublisher const is value of type for a publisher
	TypePublisher = 0
	// TypeConsumer const is value of type for a consumer
	TypeConsumer = 1
)

Variables

View Source
var DefaultTimeout time.Duration = 30 * time.Second

DefaultTimeout is the default timeout for connection

Functions

This section is empty.

Types

type Client

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

Client for RabbitMQ

func NewClient

func NewClient(ctx context.Context, logger log.ILogger, conf config.RabbitMQ, clientType uint) (*Client, error)

NewClient returns a new instance of the Client

func (*Client) Close

func (c *Client) Close() error

Close a Client obj

func (*Client) ConnectLoop

func (c *Client) ConnectLoop(timeout *time.Duration) (err error)

ConnectLoop is the func for connection in a loop with timeout

func (*Client) Handle

func (c *Client) Handle(fn func(<-chan amqp.Delivery), threads int) error

Handle queue

func (*Client) Publish

func (c *Client) Publish(body []byte) error

Publish in queue

type QueueClient

type QueueClient interface {
	Publish(body []byte) error
	Handle(fn func(<-chan amqp.Delivery), threads int) error
	Close() error
}

QueueClient interface

Jump to

Keyboard shortcuts

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