meesage_broker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 1 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetAmqpAddress() string
}

type Consumer

type Consumer interface {
	Consume(key string) (<-chan amqp.Delivery, error)
	QueueDeclare(key string) error
}

func NewConsumer

func NewConsumer(config Config) (Consumer, error)

type Producer

type Producer interface {
	Publish(key string, body []byte) error
	QueueDeclare(key string) error
}

func NewProducer

func NewProducer(config Config) (Producer, error)

type Rabbit

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

func (*Rabbit) Consume

func (r *Rabbit) Consume(key string) (<-chan amqp.Delivery, error)

Consume consumes messages from a given key

func (*Rabbit) Publish

func (r *Rabbit) Publish(key string, body []byte) error

Publish publishes any message with json body

func (*Rabbit) QueueDeclare

func (r *Rabbit) QueueDeclare(key string) error

QueueDeclare creates a queue by given key. if it doesn't exist

Jump to

Keyboard shortcuts

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