feat(broker): add rabbitmq publisher interface and struct

This commit is contained in:
Голиков Maximillian Антон
2026-11-07 14:56:14 +03:00
parent 70b1b702c7
commit 1443b07ee1
3 changed files with 22 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package broker
import (
"context"
amqp "github.com/rabbitmq/amqp091-go"
)
type Publisher interface {
Publish(ctx context.Context, routingKey string, body []byte) error
Close() error
}
type RabbitPublisher struct {
url string
conn *amqp.Connection
ch *amqp.Channel
confirms chan amqp.Confirmation
}