processor

package
v0.0.0-...-b986d7c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

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 (*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 (p *KafkaProcessor) CommitMessage(ctx context.Context, msg *kafkago.Message) error

func (*KafkaProcessor) Init

func (p *KafkaProcessor) Init() error

func (*KafkaProcessor) WriteMessage

func (p *KafkaProcessor) WriteMessage(ctx context.Context, msg kafkago.Message) error

type MessageProcessor

type MessageProcessor interface {
	StartProcessing() error
}

MessageProcessor is the interface for processing messages

Jump to

Keyboard shortcuts

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