event

package
v0.0.0-...-23502e9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSyncReadEventConsumer

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

BatchSyncReadEventConsumer 批量消费者

func (*BatchSyncReadEventConsumer) Consumer

func (c *BatchSyncReadEventConsumer) Consumer(msg []*sarama.ConsumerMessage, event []ReadEvent) error

func (*BatchSyncReadEventConsumer) ConsumerV1

func (*BatchSyncReadEventConsumer) Start

func (c *BatchSyncReadEventConsumer) Start() error

type FeedEvent

type FeedEvent struct {
	Type     string             // 内部定义,分发给不同业务方
	MetaData domain.FeedContent // 业务方具体的数据
}

type FeedEventConsumer

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

func NewFeedEventConsumer

func NewFeedEventConsumer(client sarama.Client, feedUsecase domain.FeedUsecase) *FeedEventConsumer

func (*FeedEventConsumer) Consume

func (f *FeedEventConsumer) Consume(msg *sarama.ConsumerMessage, event FeedEvent) error

type Producer

type Producer interface {
	ProduceReadEvent(c context.Context, event ReadEvent) error
}

Producer 生产者

type ReadEvent

type ReadEvent struct {
	UserID int64
	PostID int64
}

type SyncReadEventConsumer

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

SyncReadEventConsumer 消费者

func NewSyncReadEventConsumer

func NewSyncReadEventConsumer(client sarama.Client, repo domain.InteractionRepository) *SyncReadEventConsumer

func (*SyncReadEventConsumer) Consumer

func (c *SyncReadEventConsumer) Consumer(msg *sarama.ConsumerMessage, event ReadEvent) error

func (*SyncReadEventConsumer) Start

func (c *SyncReadEventConsumer) Start() error

type SyncReadEventProducer

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

SyncReadEventProducer 生产者

func NewSyncProducer

func NewSyncProducer(producer sarama.SyncProducer) *SyncReadEventProducer

func (SyncReadEventProducer) ProduceReadEvent

func (s SyncReadEventProducer) ProduceReadEvent(c context.Context, event ReadEvent) error

Jump to

Keyboard shortcuts

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