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
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
Click to show internal directories.
Click to hide internal directories.