20 lines
325 B
Go
20 lines
325 B
Go
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
|
|
}
|