publish

package
v0.0.0-...-a80dff1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TopicPublishEvent = "publish_events"

Variables

This section is empty.

Functions

This section is empty.

Types

type Producer

type Producer interface {
	ProducePublishEvent(evt PublishEvent) error
}

func NewSaramaSyncProducer

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

type PublishEvent

type PublishEvent struct {
	PostId uint  `json:"post_id"`
	Uid    int64 `json:"uid"`
}

type PublishPostEventConsumer

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

func NewPublishPostEventConsumer

func NewPublishPostEventConsumer(repo repository.PostRepository, client sarama.Client, l *zap.Logger) *PublishPostEventConsumer

func (*PublishPostEventConsumer) Start

Start 启动消费者,并开始消费 Kafka 中的消息

type SaramaSyncProducer

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

func (*SaramaSyncProducer) ProducePublishEvent

func (s *SaramaSyncProducer) ProducePublishEvent(evt PublishEvent) error

Jump to

Keyboard shortcuts

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