broker

package
v0.0.0-...-bcec15c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewController

func NewController(p ControllerParams) pb.BrokerServer

Types

type ControllerParams

type ControllerParams struct {
	fx.In
	Service Service
	Logger  *zap.SugaredLogger
}

type Delivery

type Delivery struct {
	DeliveryTag int64
	Redelivered bool
	Exchange    string
	RoutingKey  string
	Body        Message
}

type Message

type Message []byte

type MessageQueue

type MessageQueue struct {
	Queue
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(name string) *MessageQueue

func (*MessageQueue) Ack

func (q *MessageQueue) Ack(deliveryTag int64)

func (*MessageQueue) Get

func (q *MessageQueue) Get(autoAck bool) (*Delivery, bool)

func (*MessageQueue) Nack

func (q *MessageQueue) Nack(deliveryTag int64, requeue bool)

func (*MessageQueue) Publish

func (q *MessageQueue) Publish(delivery *Delivery)

type Queue

type Queue struct {
	Name string
}

type Service

type Service interface {
	Consume(queue string, consumer string, autoAck bool) (<-chan Delivery, error)
	ExchangeDeclare(name string) error
	Publish(exchange, key string, msg []byte) error
	Get(queue string, autoAck bool) (msg Delivery, ok bool, err error)
	QueueBind(name, key, exchange string) error
	QueueDeclare(name string) (Queue, error)
}

func NewService

func NewService() Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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