Documentation ¶
Index ¶
- func NewRabbitMQConnection(cfg *Config) (*amqp.Connection, error)
- type AMQPPublisher
- type Config
- type Publisher
- func (p *Publisher) Close()
- func (p *Publisher) GetChannel() *amqp.Channel
- func (p *Publisher) GetConnection() *amqp.Connection
- func (p *Publisher) Publish(ctx context.Context, exchange, key string, msg amqp.Publishing) error
- func (p *Publisher) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRabbitMQConnection ¶
func NewRabbitMQConnection(cfg *Config) (*amqp.Connection, error)
NewRabbitMQConnection ...
Types ¶
type AMQPPublisher ¶
type AMQPPublisher interface { PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error Publish(ctx context.Context, exchange, key string, msg amqp.Publishing) error GetChannel() *amqp.Channel GetConnection() *amqp.Connection Close() }
AMQPPublisher ...
type Config ¶
type Config struct {
URI string `default:"amqp://guest:guest@localhost:5672"`
}
Config for amqp rabbitmq
type Publisher ¶
type Publisher struct { AMQPConn *amqp.Connection AMQPChan *amqp.Channel }
Publisher ...
func (*Publisher) GetChannel ¶
func (*Publisher) GetConnection ¶
func (p *Publisher) GetConnection() *amqp.Connection
func (*Publisher) PublishWithContext ¶
func (p *Publisher) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
PublishWithContext ...
Click to show internal directories.
Click to hide internal directories.