Documentation ¶
Index ¶
- type ChatProcessor
- type DiscordMessageProcessor
- type KafkaProcessor
- func (p *KafkaProcessor) Close() error
- func (p *KafkaProcessor) CollectMessages(ctx context.Context, channelLength int) <-chan *kafkago.Message
- func (p *KafkaProcessor) CommitMessage(ctx context.Context, msg *kafkago.Message) error
- func (p *KafkaProcessor) Init() error
- func (p *KafkaProcessor) WriteMessage(ctx context.Context, msg kafkago.Message) error
- type MessageProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatProcessor ¶
type ChatProcessor struct {
// contains filtered or unexported fields
}
ChatProcessor handles all the chat messages from redis pubsub and discord and transfers them to the other platform
func NewChatProcessor ¶
func NewChatProcessor(u *usecase.UserHandler, r *usecase.RedisHandler, d *discord.DiscordHandler, c *coflnet.ChatApi) *ChatProcessor
func (*ChatProcessor) StartProcessing ¶
func (p *ChatProcessor) StartProcessing() error
type DiscordMessageProcessor ¶
type DiscordMessageProcessor struct {
// contains filtered or unexported fields
}
sends messages from a kafka topic to discord
func NewDiscordMessageProcessor ¶
func NewDiscordMessageProcessor(d *discord.DiscordHandler) *DiscordMessageProcessor
func (*DiscordMessageProcessor) StartProcessing ¶
func (p *DiscordMessageProcessor) StartProcessing() error
type KafkaProcessor ¶
type KafkaProcessor struct { // Host is the host of the kafka broker Host string // Topic is the topic to consume Topic string // ConsumerGroup is the consumer group to use ConsumerGroup string // contains filtered or unexported fields }
func (*KafkaProcessor) Close ¶
func (p *KafkaProcessor) Close() error
func (*KafkaProcessor) CollectMessages ¶
func (p *KafkaProcessor) CollectMessages(ctx context.Context, channelLength int) <-chan *kafkago.Message
CollectMessages collects messages from the kafka reader and returns them in a channel if the kafka read returns an error the function panics The caller is responsible for committing the messages
func (*KafkaProcessor) CommitMessage ¶
func (*KafkaProcessor) Init ¶
func (p *KafkaProcessor) Init() error
func (*KafkaProcessor) WriteMessage ¶
type MessageProcessor ¶
type MessageProcessor interface {
StartProcessing() error
}
MessageProcessor is the interface for processing messages
Click to show internal directories.
Click to hide internal directories.