rabbitmq

package
v0.0.0-...-8fb0787 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func (*Config) AMQPConfig

func (c *Config) AMQPConfig() *Config

AMQPConfig ...

type Publisher

type Publisher struct {
	AMQPConn *amqp.Connection
	AMQPChan *amqp.Channel
}

Publisher ...

func NewPublisher

func NewPublisher(cfg *Config) (*Publisher, error)

NewPublisher ...

func (*Publisher) Close

func (p *Publisher) Close()

Close ...

func (*Publisher) GetChannel

func (p *Publisher) GetChannel() *amqp.Channel

func (*Publisher) GetConnection

func (p *Publisher) GetConnection() *amqp.Connection

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, exchange, key string, msg amqp.Publishing) error

Publish ...

func (*Publisher) PublishWithContext

func (p *Publisher) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

PublishWithContext ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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