rabbitmq

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultWaitDuration = time.Millisecond * 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitMQ

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

func New

func New(cfg *config.Resource) (*RabbitMQ, error)

New creates and validates the resource params for the connection initialized in Open()

func (*RabbitMQ) Close added in v1.4.1

func (c *RabbitMQ) Close() error

Close cleans up the underlying connection

func (*RabbitMQ) Fetch

func (c *RabbitMQ) Fetch(target string) ([][]byte, error)

Fetch attempts to retrieve a message from the passed target

func (*RabbitMQ) Listen

func (c *RabbitMQ) Listen(target string) error

Listen creates a consumer on the passed target, creates the queue, and puts the messages into consumedMessage map for later access

func (*RabbitMQ) Open added in v1.4.1

func (c *RabbitMQ) Open() error

Open attempts a dial connection to the AMQP server

func (*RabbitMQ) Publish

func (c *RabbitMQ) Publish(target string, payload []byte) error

Publish attempts to publish a message to the passed target

func (*RabbitMQ) PublishFromFile added in v1.4.1

func (c *RabbitMQ) PublishFromFile(target string, fileName string) error

PublishFromFile attempts to publish a message read from a file to the passed target

func (*RabbitMQ) Ready

func (c *RabbitMQ) Ready() error

Ready attempts to publish a message to a test queue, if no error is returned the server is deemed ready

func (*RabbitMQ) Reset

func (c *RabbitMQ) Reset() error

Reset empties the consumedMessage map and cleans up the queues

Jump to

Keyboard shortcuts

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