rabbitmq

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 6 Imported by: 1

README

rabbitmq

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStream

type BaseStream struct {
	Name     string
	Exchange string
	// contains filtered or unexported fields
}

BaseStream - basic class for rabbit-mq

func (*BaseStream) Close

func (stream *BaseStream) Close()

Close - close channel and connection to RabbitMq

func (*BaseStream) Open

func (stream *BaseStream) Open(connection *RabbitMq, exchange, name string) (err error)

Open - open channel to RabbitMq

type Input

type Input struct {
	BaseStream

	Stream <-chan amqp.Delivery
}

Input - input stream

func (*Input) Init

func (input *Input) Init(prefetchCount, prefetchSize *int) (err error)

Init - init stream

type Output

type Output struct {
	BaseStream
}

Output - output stream

func (*Output) Send

func (output *Output) Send(message []byte, priority uint8) (err error)

Send - send message to queue

func (*Output) SendWithHeader

func (output *Output) SendWithHeader(message []byte, header amqp.Table, priority uint8) (err error)

SendWithHeader - send message to queue

type OutputDestination

type OutputDestination struct {
	Exchange  string `yaml:"exchange"`  // Exchange
	QueueName string `yaml:"queueName"` // Name of queue
}

* OutputDestination - output destination

type RabbitMq

type RabbitMq struct {
	Host          string                        `yaml:"host"`          // Host
	Port          int32                         `yaml:"port"`          // Port
	User          string                        `yaml:"user"`          // User
	Password      string                        `yaml:"password"`      // Password
	Exchange      string                        `yaml:"exchange"`      // Exchange
	QueueName     *string                       `yaml:"queueName"`     // Name of queue
	PrefetchSize  *int                          `yaml:"prefetchSize"`  // Prefetch size
	PrefetchCount *int                          `yaml:"prefetchCount"` // Prefetch count
	Destinations  *map[string]OutputDestination `yaml:"destinations"`  // Defined destination
	// contains filtered or unexported fields
}

RabbitMq - rabbit-mq configuration and provider stream

func (*RabbitMq) GetConnection

func (mq *RabbitMq) GetConnection() (connection *amqp.Connection, channel *amqp.Channel, err error)

GetConnection - get connection to RabbitMq

func (*RabbitMq) GetConnectionString

func (mq *RabbitMq) GetConnectionString() string

GetConnectionString - get connection string for RabbitMq

func (*RabbitMq) GetInput

func (mq *RabbitMq) GetInput(name string) (input *Input, err error)

GetInput - get input stream

func (*RabbitMq) GetOutput

func (mq *RabbitMq) GetOutput(name string) (output *Output, err error)

GetOutput - get output stream

func (*RabbitMq) GetOutputForDestination

func (mq *RabbitMq) GetOutputForDestination(destination string) (output *Output, err error)

GetOutputForDestination - get output stream for destination

func (*RabbitMq) Init

func (mq *RabbitMq) Init() error

Init - initialize properties

Jump to

Keyboard shortcuts

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