email

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is service providers.

Functions

func FormatMail

func FormatMail(from string, to []string, subject, body any) string

func SendMail

func SendMail(cli *smtp.Client, from string, to []string, subject, body string) error

Types

type EmailConsumer

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

func NewEmailConsumer

func NewEmailConsumer(ms *EmailService) *EmailConsumer

func (*EmailConsumer) Cleanup

func (*EmailConsumer) ConsumeClaim

func (s *EmailConsumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*EmailConsumer) Setup

type EmailService

type EmailService struct {
	emailApi.UnimplementedEmailServer
	// contains filtered or unexported fields
}

func NewEmailService

func NewEmailService(c *conf.EmailConfig) *EmailService

func (*EmailService) SendEmail

func (ms *EmailService) SendEmail(ctx context.Context, req *emailApi.SendEmailReq) (*emailApi.Empty, error)

type SmtpPool

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

func NewSmtpPool

func NewSmtpPool(c *conf.SmtpConfig, max int) (*SmtpPool, error)

func (*SmtpPool) Get

func (p *SmtpPool) Get() (*smtp.Client, error)

func (*SmtpPool) Put

func (p *SmtpPool) Put(cli *smtp.Client)

Jump to

Keyboard shortcuts

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