rabbitmq

package
v0.0.0-...-d389d3b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExchange = "events"

Variables

View Source
var Module = fx.Options(
	consumers,
	consumerRunners,
	consumerManager,
	publishers,
)

Functions

func NewRabbitMQPublisher

func NewRabbitMQPublisher(config *config.AppConfig, logger logger.Logger) pubsub.AMQPPublisher

Types

type Consumer

type Consumer interface {
	Consume(ctx context.Context, runner ConsumerRunner)
}

func NewRabbitMQConsumer

func NewRabbitMQConsumer(config *config.AppConfig, logger logger.Logger) Consumer

type ConsumerManager

type ConsumerManager struct {
	ConsumerRunners []ConsumerRunner
}

func NewConsumerManager

func NewConsumerManager(consumerRunners []ConsumerRunner) *ConsumerManager

func (ConsumerManager) Run

func (c ConsumerManager) Run(ctx context.Context)

type ConsumerRunner

type ConsumerRunner interface {
	Run(ctx context.Context)
	Do(ctx context.Context)
	Options() ConsumerRunnerOptions
}

func NewSimpleConsumerRunner

func NewSimpleConsumerRunner(consumer Consumer) ConsumerRunner

type ConsumerRunnerOptions

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

type RabbitMQConsumer

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

func (*RabbitMQConsumer) Consume

func (c *RabbitMQConsumer) Consume(ctx context.Context, runner ConsumerRunner)

type RabbitMQPublisher

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

func (*RabbitMQPublisher) Publish

func (r *RabbitMQPublisher) Publish(ctx context.Context, data any, routingKey string) error

type SimpleConsumerRunner

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

func (SimpleConsumerRunner) Do

func (SimpleConsumerRunner) Options

func (SimpleConsumerRunner) Run

Jump to

Keyboard shortcuts

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