Documentation ¶
Index ¶
- func ConvertDeliveryToPublishing(message amqp.Delivery) amqp.Publishing
- func LoggedCloser(closer io.Closer)
- type AMQPClient
- func (a *AMQPClient) ClientName() string
- func (a *AMQPClient) Close()
- func (a *AMQPClient) Consumer(queueName, topic, exchangeName string, retryDelay time.Duration) error
- func (a *AMQPClient) Enabled() bool
- func (a *AMQPClient) Listen(queue string) (<-chan amqp.Delivery, error)
- func (a *AMQPClient) LoggedAck(message amqp.Delivery)
- func (a *AMQPClient) LoggedReject(message amqp.Delivery, requeue bool)
- func (a *AMQPClient) Ping() error
- func (a *AMQPClient) Publish(payload amqp.Publishing, exchange string) error
- func (a *AMQPClient) Publisher(exchangeName, exchangeType string, args amqp.Table) error
- func (a *AMQPClient) Reconnect() error
- func (a *AMQPClient) StopChannel()
- func (a *AMQPClient) Vhost() string
- type Mail
- type MailRequest
- func (mr MailRequest) As(sender string) MailRequest
- func (mr MailRequest) Check() error
- func (mr MailRequest) ConvertToMail(content io.Reader) Mail
- func (mr MailRequest) Data(payload interface{}) MailRequest
- func (mr MailRequest) From(fromEmail string) MailRequest
- func (mr MailRequest) Template(Tpl string) MailRequest
- func (mr MailRequest) To(recipients ...string) MailRequest
- func (mr MailRequest) WithSubject(subject string) MailRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDeliveryToPublishing ¶ added in v1.12.0
func ConvertDeliveryToPublishing(message amqp.Delivery) amqp.Publishing
ConvertDeliveryToPublishing convert a delivery to a publishing, for requeuing
func LoggedCloser ¶ added in v1.11.0
LoggedCloser closes a ressources with handling error
Types ¶
type AMQPClient ¶ added in v1.12.0
type AMQPClient struct {
// contains filtered or unexported fields
}
AMQPClient wraps all object required for AMQP usage
func GetAMQPClient ¶ added in v1.12.0
func GetAMQPClient(uri string) (client *AMQPClient, err error)
GetAMQPClient inits AMQP connection, channel and queue
func (*AMQPClient) ClientName ¶ added in v1.12.1
func (a *AMQPClient) ClientName() string
ClientName returns client name
func (*AMQPClient) Close ¶ added in v1.12.0
func (a *AMQPClient) Close()
Close closes opened ressources
func (*AMQPClient) Consumer ¶ added in v1.24.3
func (a *AMQPClient) Consumer(queueName, topic, exchangeName string, retryDelay time.Duration) error
Consumer configures client for consumming from given queue, bind to given exchange
func (*AMQPClient) Enabled ¶ added in v1.12.0
func (a *AMQPClient) Enabled() bool
Enabled checks if connection is setup
func (*AMQPClient) Listen ¶ added in v1.12.0
func (a *AMQPClient) Listen(queue string) (<-chan amqp.Delivery, error)
Listen listens to configured queue
func (*AMQPClient) LoggedAck ¶ added in v1.16.8
func (a *AMQPClient) LoggedAck(message amqp.Delivery)
LoggedAck ack a message with error handling
func (*AMQPClient) LoggedReject ¶ added in v1.16.8
func (a *AMQPClient) LoggedReject(message amqp.Delivery, requeue bool)
LoggedReject reject a message with error handling
func (*AMQPClient) Ping ¶ added in v1.12.0
func (a *AMQPClient) Ping() error
Ping checks if connection is live
func (*AMQPClient) Publish ¶ added in v1.24.3
func (a *AMQPClient) Publish(payload amqp.Publishing, exchange string) error
Publish sends payload to the underlying exchange
func (*AMQPClient) Publisher ¶ added in v1.24.3
func (a *AMQPClient) Publisher(exchangeName, exchangeType string, args amqp.Table) error
Publisher configures client for publishing to given exchange
func (*AMQPClient) Reconnect ¶ added in v1.22.2
func (a *AMQPClient) Reconnect() error
Reconnect to amqp
func (*AMQPClient) StopChannel ¶ added in v1.23.0
func (a *AMQPClient) StopChannel()
StopChannel cancel existing channel
func (*AMQPClient) Vhost ¶ added in v1.12.0
func (a *AMQPClient) Vhost() string
Vhost returns connection Vhost
type MailRequest ¶ added in v1.11.0
type MailRequest struct { Payload interface{} Tpl string FromEmail string Sender string Subject string Recipients []string }
MailRequest describes an email to be sent
func NewMailRequest ¶ added in v1.11.0
func NewMailRequest() MailRequest
NewMailRequest create a new email
func (MailRequest) As ¶ added in v1.11.0
func (mr MailRequest) As(sender string) MailRequest
As set sender
func (MailRequest) Check ¶ added in v1.11.0
func (mr MailRequest) Check() error
Check checks if current instance is valid
func (MailRequest) ConvertToMail ¶ added in v1.11.0
func (mr MailRequest) ConvertToMail(content io.Reader) Mail
ConvertToMail convert mail request to Mail with given content
func (MailRequest) Data ¶ added in v1.11.0
func (mr MailRequest) Data(payload interface{}) MailRequest
Data set payload
func (MailRequest) From ¶ added in v1.11.0
func (mr MailRequest) From(fromEmail string) MailRequest
From set from
func (MailRequest) Template ¶ added in v1.11.0
func (mr MailRequest) Template(Tpl string) MailRequest
Template set template
func (MailRequest) To ¶ added in v1.11.0
func (mr MailRequest) To(recipients ...string) MailRequest
To add recipients to list
func (MailRequest) WithSubject ¶ added in v1.11.0
func (mr MailRequest) WithSubject(subject string) MailRequest
WithSubject set subject