post

package
v0.0.0-...-f48fc76 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicDeadLetter = "post_events_dlq" // 死信队列主题
	MaxRetries      = 3                 // 最大重试次数
)
View Source
const (
	TopicReadEvent = "read_events"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventConsumer

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

func (*EventConsumer) Start

func (i *EventConsumer) Start(ctx context.Context) error

type PostDeadLetterConsumer

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

func (*PostDeadLetterConsumer) Start

type Producer

type Producer interface {
	ProduceReadEvent(evt ReadEvent) error
}

func NewSaramaSyncProducer

func NewSaramaSyncProducer(producer sarama.SyncProducer) Producer

type ReadEvent

type ReadEvent struct {
	PostId  uint
	Uid     int64
	Title   string
	Content string
	PlateID int64
}

type SaramaSyncProducer

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

func (*SaramaSyncProducer) ProduceReadEvent

func (s *SaramaSyncProducer) ProduceReadEvent(evt ReadEvent) error

Jump to

Keyboard shortcuts

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