Documentation
¶
Index ¶
Constants ¶
View Source
const ( EmailQueue = "emails" EmailSendTask = "email:send" MaxRetry = 3 TimeOut = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func NewQueueMux ¶
func NewQueueMux( emailHandler *EmailHandler, ) *asynq.ServeMux
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewQueueConsumer ¶
type EmailHandler ¶
type EmailHandler struct {
// contains filtered or unexported fields
}
func NewEmailHandler ¶
func NewEmailHandler(mailerService *email.MailService) *EmailHandler
func (*EmailHandler) SendEmailHandler ¶
type EmailPayload ¶
type EmailPayload struct {
To string `json:"to"`
Subject string `json:"subject"`
Body string `json:"body"`
}
func (*EmailPayload) Data ¶
func (e *EmailPayload) Data() ([]byte, error)
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewQueueProducer ¶
func (*Producer) SendEmail ¶
func (p *Producer) SendEmail(payload *EmailPayload) error
Click to show internal directories.
Click to hide internal directories.