email

package
v0.0.0-...-f664ad0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TopicEmail = "email_events"

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailConsumer

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

func NewEmailConsumer

func NewEmailConsumer(repo repository.EmailRepository, client sarama.Client, l *zap.Logger) *EmailConsumer

func (*EmailConsumer) HandleMessage

func (e *EmailConsumer) HandleMessage(msg *sarama.ConsumerMessage, emailEvent EmailEvent) error

func (*EmailConsumer) Start

func (e *EmailConsumer) Start(ctx context.Context) error

type EmailEvent

type EmailEvent struct {
	Email string
}

EmailEvent 代表单个短信验证码事件

type Producer

type Producer interface {
	ProduceEmail(ctx context.Context, evt EmailEvent) error
}

func NewSaramaSyncProducer

func NewSaramaSyncProducer(producer sarama.SyncProducer, logger *zap.Logger) Producer

NewSaramaSyncProducer 创建一个新的SaramaSyncProducer实例

type SaramaSyncProducer

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

SaramaSyncProducer 实现Producer接口的结构体

func (*SaramaSyncProducer) ProduceEmail

func (s *SaramaSyncProducer) ProduceEmail(ctx context.Context, evt EmailEvent) error

ProduceEmail 发送邮箱验证码事件到Kafka

Jump to

Keyboard shortcuts

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