service

package
v0.0.0-...-5b9e52f Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBarCode

func GetBarCode(id string) (img image.Image, err error)

func GetQrCode

func GetQrCode(id string) (img image.Image, err error)

func NewMailService

func NewMailService(
	mailSender MailSender,
	screeningService ScreeningService,
	Subjects map[MailSubjectType]string,
	TemplatesNames map[MailSubjectType]string) (*mailService, error)

Types

type MailSender

type MailSender interface {
	SendEmail(ctx context.Context, email string, subject string, emailBody, altBody string) error
}

type MailService

type MailService interface {
	SendTokenToEmail(ctx context.Context, email, url string, topic TokenTopic, urlTtl time.Duration) error
	SendOrderCreatedNotification(ctx context.Context, email string, order models.Order) error
}

type MailSubjectType

type MailSubjectType string
const (
	EmailVerfication MailSubjectType = "EMAIL_VERIFICATION"
	PasswordChanging MailSubjectType = "CHANGING_PASSWORD"
	OrderCreated     MailSubjectType = "ORDER_CREATED"
)

type ScreeningService

type ScreeningService interface {
	GetScreeningInfo(ctx context.Context, screeningId int64) (models.Screening, error)
}

type TokenTopic

type TokenTopic int32
const (
	EmailVerificationTopic TokenTopic = iota
	PasswordChangingTopic
)

func (TokenTopic) MailSubjectType

func (t TokenTopic) MailSubjectType() MailSubjectType

Jump to

Keyboard shortcuts

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