messages

package
v0.0.0-...-41acbf8 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package messages ./bots/IRC/pkg/adapters/message_processing/batch_processor.go

Package messages ./bots/IRC/pkg/adapters/message_processing/irc.go

Package messages ./bots/IRC/pkg/adapters/message_processing/message_handler.go

Package messages ./bots/IRC/pkg/adapters/messages/mistral7b_analyzer.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchProcessor

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

func NewBatchProcessor

func NewBatchProcessor(processInterval time.Duration, mistralURL, stream, subject, natsURL string, natsOpts []nats.Option) *BatchProcessor

func (*BatchProcessor) AddMessage

func (bp *BatchProcessor) AddMessage(event cloudevents.Event)

func (*BatchProcessor) Start

func (bp *BatchProcessor) Start(ctx context.Context)

type IRCAdapter

type IRCAdapter struct {
	Connection *ircevent.Connection
	// contains filtered or unexported fields
}

func NewIRCAdapter

func NewIRCAdapter() *IRCAdapter

func (*IRCAdapter) Connect

func (irc *IRCAdapter) Connect(ctx context.Context, commandEventsHandler *broker.CloudEventsNATSHandler) error

func (*IRCAdapter) Listen

func (irc *IRCAdapter) Listen(onMessage func(message common.IRCMessage))

func (*IRCAdapter) Send

func (irc *IRCAdapter) Send(channel string, message string)

type IRCAdapterConfig

type IRCAdapterConfig struct {
	Nick            string `envconfig:"BOT_NICK" default:"threadr" required:"true"`
	Server          string `envconfig:"BOT_SERVER" default:"irc.choopa.net:6667" required:"true"`
	Channels        string `envconfig:"BOT_CHANNELS" default:"#!chases,#chases,#𝓉𝓌𝑒𝓇𝓀𝒾𝓃,#singularity" required:"true"`
	BotSaslLogin    string `envconfig:"BOT_SASL_LOGIN"`
	BotSaslPassword string `envconfig:"BOT_SASL_PASSWORD"`
}

type MistralConfig

type MistralConfig struct {
	MistralURL string `envconfig:"MISTRALURL" default:"http://localhost:5001" required:"true"`
}

type MistralMessageHandler

type MistralMessageHandler struct {
	Config MistralConfig
}

func NewMistralMessageHandler

func NewMistralMessageHandler() *MistralMessageHandler

NewMistralMessageHandler creates a new MistralMessageHandler.

func (*MistralMessageHandler) Handle

Handle processes the received message by sending it to the Mistral service.

type SimpleMessageHandler

type SimpleMessageHandler struct {
	GraphDB ports.GraphDatabasePort
}

SimpleMessageHandler implements the MessageHandler interface.

func NewSimpleMessageHandler

func NewSimpleMessageHandler(graphDB ports.GraphDatabasePort) *SimpleMessageHandler

NewSimpleMessageHandler creates a new instance of SimpleMessageHandler.

func (*SimpleMessageHandler) Handle

Handle processes the received message.

Jump to

Keyboard shortcuts

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