model

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: MIT Imports: 10 Imported by: 4

Documentation

Index

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

func LoggedCloser(closer io.Closer)

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, exchangeName, queueName string, delay time.Duration) (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) DelayedExchangeName added in v1.24.0

func (a *AMQPClient) DelayedExchangeName() string

DelayedExchangeName returns delayed exchange name

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) Listen added in v1.12.0

func (a *AMQPClient) Listen() (<-chan amqp.Delivery, error)

Listen listens to 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) QueueName added in v1.12.0

func (a *AMQPClient) QueueName() string

QueueName returns queue name

func (*AMQPClient) Reconnect added in v1.22.2

func (a *AMQPClient) Reconnect() error

Reconnect to amqp

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) SendExchange added in v1.24.0

func (a *AMQPClient) SendExchange(payload amqp.Publishing, exchangeName string) error

SendExchange sends payload to the given exchange

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 Mail

type Mail struct {
	From    string
	Sender  string
	Subject string
	Content io.Reader
	To      []string
}

Mail describe envelope of an email

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

Jump to

Keyboard shortcuts

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