ports

package
v0.0.0-...-1457349 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ports ./bots/IRC/pkg/ports/account.go

Package ports ./bots/IRC/pkg/ports/composite_message_handler.go

Package ports ./bots/IRC/pkg/ports/graph.go

Package ports ./bots/IRC/pkg/ports/message_handler.go

Package ports ./bots/IRC/pkg/ports/message_processing.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	PublishEvent(ctx context.Context, sequence int, message []byte) error
	Subscribe(ctx context.Context, onMessage func(message chat.IRCMessage) error) error
}

type CompositeMessageHandler

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

CompositeMessageHandler holds multiple MessageHandlers and delegates message_processing to them.

func NewCompositeMessageHandler

func NewCompositeMessageHandler(handlers ...MessageHandler) *CompositeMessageHandler

NewCompositeMessageHandler creates a new CompositeMessageHandler with the given handlers.

func (*CompositeMessageHandler) Handle

Handle delegates the event to all contained handlers.

type GraphDatabasePort

type GraphDatabasePort interface {
	AddRelationship(ctx context.Context, fromUser string, toUser string, relationshipType string) error
	AddOrUpdateRelationship(ctx context.Context, fromUser string, toUser string, relationshipType string) error
	QueryRelationships(ctx context.Context, user string) ([]Relationship, error)
}

type MessageAdapter

type MessageAdapter interface {
	Connect(ctx context.Context, handler *broker.CloudEventsNATSHandler) error
	Listen(onMessage func(msg chat.IRCMessage))
	// Send takes the channel and message
	Send(channel string, message string)
}

MessageAdapter is an interface for connecting to various message sources and listening for message_processing.

type MessageHandler

type MessageHandler interface {
	Handle(ctx context.Context, event cloudevents.Event) error
}

MessageHandler defines the interface for handling message_processing.

type Relationship

type Relationship struct {
	FromUser string
	ToUser   string
	Type     string
}

Jump to

Keyboard shortcuts

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