bus

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InboundMessage

type InboundMessage struct {
	Channel   string
	SenderID  string
	ChatID    string
	Content   string
	Timestamp time.Time
	Media     []string
	Metadata  map[string]any
}

InboundMessage received from a channel

func (*InboundMessage) SessionKey

func (m *InboundMessage) SessionKey() string

SessionKey returns unique session identifier

type MessageBus

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

MessageBus handles message routing between channels and agent

func NewMessageBus

func NewMessageBus(bufferSize int) *MessageBus

NewMessageBus creates a new message bus

func (*MessageBus) Close

func (b *MessageBus) Close()

Close closes both channels

func (*MessageBus) Inbound

func (b *MessageBus) Inbound() <-chan *InboundMessage

Inbound returns the inbound channel for consuming

func (*MessageBus) Outbound

func (b *MessageBus) Outbound() <-chan *OutboundMessage

Outbound returns the outbound channel for consuming

func (*MessageBus) PublishInbound

func (b *MessageBus) PublishInbound(msg *InboundMessage)

PublishInbound sends a message to the agent

func (*MessageBus) PublishOutbound

func (b *MessageBus) PublishOutbound(msg *OutboundMessage)

PublishOutbound sends a message to channels

type OutboundMessage

type OutboundMessage struct {
	Channel  string
	ChatID   string
	Content  string
	ReplyTo  string
	Media    []string
	Metadata map[string]any
}

OutboundMessage to send to a channel

Jump to

Keyboard shortcuts

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