rabbitmq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rabbitmq provides a implementation for RabbitMQ transport.

Index

Constants

View Source
const DefaultAddr = "amqp://guest:guest@localhost:5672/"

DefaultAddr is connection string used to connect to local RabbitMQ instance on default port.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a function on the options for a RabbitMQ transport.

func WithConnection

func WithConnection(c *amqp.Connection) Option

WithConnection is an Option to set underlying RabbitMQ connection.

type Options

type Options struct {
	Connection *amqp.Connection
}

Options can be used to create a customized transport.

type Transport

type Transport struct {
	sync.Mutex

	// exported fields
	Addr string
	// contains filtered or unexported fields
}

Transport is a vice.Transport for RabbitMQ.

func New

func New(opts ...Option) *Transport

New returns a new transport

func (*Transport) Done

func (t *Transport) Done() chan struct{}

Done gets a channel which is closed when the transport has successfully stopped.

func (*Transport) ErrChan

func (t *Transport) ErrChan() <-chan error

ErrChan gets the channel on which errors are sent.

func (*Transport) Receive

func (t *Transport) Receive(name string) <-chan []byte

Receive gets a channel on which to receive messages with the specified name.

func (*Transport) Send

func (t *Transport) Send(name string) chan<- []byte

Send gets a channel on which messages with the specified name may be sent.

func (*Transport) Stop

func (t *Transport) Stop()

Stop stops the transport. The channel returned from Done() will be closed when the transport has stopped.

Jump to

Keyboard shortcuts

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