Documentation ¶
Index ¶
- Variables
- func ConvertDeliveryToPublishing(message amqp.Delivery) amqp.Publishing
- func LoggedAck(message amqp.Delivery)
- func LoggedCloser(closer io.Closer)
- func LoggedReject(message amqp.Delivery, requeue bool)
- type AMQPClient
- func (a AMQPClient) ClientName() string
- func (a AMQPClient) Close()
- func (a AMQPClient) Enabled() bool
- func (a AMQPClient) ExchangeName() string
- func (a AMQPClient) GetGarbage() (amqp.Delivery, bool, error)
- func (a AMQPClient) Listen() (<-chan amqp.Delivery, error)
- func (a AMQPClient) Ping() error
- func (a AMQPClient) QueueName() string
- func (a AMQPClient) Send(payload amqp.Publishing) error
- 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
- type Sender
Constants ¶
This section is empty.
Variables ¶
var ( // EmptyMailRequest for not found case EmptyMailRequest = MailRequest{} )
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
func LoggedReject ¶ added in v1.12.0
LoggedReject reject a message with error handling
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, exchangeName, queueName 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) Enabled ¶ added in v1.12.0
func (a AMQPClient) Enabled() bool
Enabled checks if connection is setup
func (AMQPClient) ExchangeName ¶ added in v1.12.0
func (a AMQPClient) ExchangeName() string
ExchangeName returns exchange name
func (AMQPClient) GetGarbage ¶ added in v1.12.0
func (a AMQPClient) GetGarbage() (amqp.Delivery, bool, error)
GetGarbage get a message from the garbage
func (AMQPClient) Listen ¶ added in v1.12.0
func (a AMQPClient) Listen() (<-chan amqp.Delivery, error)
Listen listen to queue
func (AMQPClient) Ping ¶ added in v1.12.0
func (a AMQPClient) Ping() error
Ping checks if connection is live
func (AMQPClient) QueueName ¶ added in v1.12.0
func (a AMQPClient) QueueName() string
QueueName returns queue name
func (AMQPClient) Send ¶ added in v1.12.0
func (a AMQPClient) Send(payload amqp.Publishing) error
Send sends payload to the underlying exchange and queue
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