rabbitmq

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 17 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 Relay added in v0.4.0

func Relay(opts *cli.Options) error

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
	Consumer *rabbit.Rabbit
	MsgDesc  *desc.MessageDescriptor
	// contains filtered or unexported fields
}

RabbitMQ 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 New added in v0.5.0

func New(opts *cli.Options, md *desc.MessageDescriptor) (*RabbitMQ, error)

func (*RabbitMQ) Read

func (r *RabbitMQ) Read() error

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

func (*RabbitMQ) Write

func (r *RabbitMQ) Write(ctx context.Context, 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.

type Relayer added in v0.5.0

type Relayer struct {
	Options *cli.Options
	Channel *amqp.Channel
	MsgDesc *desc.MessageDescriptor
	RelayCh chan interface{}

	Looper         *director.FreeLooper
	DefaultContext context.Context
	// contains filtered or unexported fields
}

func (*Relayer) Relay added in v0.5.0

func (r *Relayer) Relay() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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