rabbitmq

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(opts *cli.Options) error

Read is the entry point function for performing read operations in RabbitMQ.

This is where we verify that the provided arguments and flag combination makes sense/are valid; this is also where we will perform our initial conn.

func Write

func Write(opts *cli.Options) error

Write is the entry point function for performing write operations in RabbitMQ.

This is where we verify that the passed args and flags combo makes sense, attempt to establish a connection, parse protobuf before finally attempting to perform the write.

Types

type RabbitMQ

type RabbitMQ struct {
	Options *cli.Options
	Channel *amqp.Channel
	MsgDesc *desc.MessageDescriptor
	// contains filtered or unexported fields
}

Reader holds all attributes required for performing a read/write operations in RabbitMQ. This struct should be instantiated via the rabbitmq.Read(..) or rabbitmq.Write(..) functions.

func (*RabbitMQ) Read

func (r *RabbitMQ) Read() error

Read will attempt to consume one or more messages from the established rabbit channel.

NOTE: This method will not tolerate network hiccups. If you plan on running this long-term - we should add reconnect support.

func (*RabbitMQ) Write

func (r *RabbitMQ) Write(value []byte) error

Write is a wrapper for amqp Publish method. We wrap it so that we can mock it in tests, add logging etc.

Jump to

Keyboard shortcuts

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