mail

package
v0.0.0-...-63da400 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailGenerator

type EmailGenerator struct {
	// contains filtered or unexported fields
}

EmailGenerator is the struct keeping the base config of hermes

func NewEmailGenerator

func NewEmailGenerator(config *config.App) *EmailGenerator

NewEmailGenerator creates the base config of hermes

func (*EmailGenerator) GenerateConfirmEmail

func (g *EmailGenerator) GenerateConfirmEmail(fullname string, link string) (string, error)

GenerateConfirmEmail generate a custom confirm email

func (*EmailGenerator) GenerateRestePasswordEmail

func (g *EmailGenerator) GenerateRestePasswordEmail(fullname string, link string) (string, error)

GenerateRestePasswordEmail generate a custom reset password email

type EmailSendRequest

type EmailSendRequest struct {
	To      string
	Title   string
	Content string
}

EmailSendRequest represents a mail sending request

type Worker

type Worker struct {
	ID          int
	WorkerQueue chan EmailSendRequest
	QuitChan    chan bool
	// contains filtered or unexported fields
}

Worker is the struct maintaining worker's state

func NewSenderWorker

func NewSenderWorker(workerQueue chan EmailSendRequest, config *config.Email, logger *log.Logger) *Worker

NewSenderWorker creates, and returns a new Worker object.

func (*Worker) Start

func (w *Worker) Start()

Start launches the worker by starting a goroutine

func (*Worker) Stop

func (w *Worker) Stop()

Stop tells the worker to stop listening for work requests. Note that the worker will only stop *after* it has finished its work.

Jump to

Keyboard shortcuts

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