bus

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 2 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            `json:"channel"`
	SenderID   string            `json:"sender_id"`
	ChatID     string            `json:"chat_id"`
	Content    string            `json:"content"`
	Media      []string          `json:"media,omitempty"`
	SessionKey string            `json:"session_key"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}

type MessageBus

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

func NewMessageBus

func NewMessageBus() *MessageBus

func (*MessageBus) Close

func (mb *MessageBus) Close()

func (*MessageBus) ConsumeInbound

func (mb *MessageBus) ConsumeInbound(ctx context.Context) (InboundMessage, bool)

func (*MessageBus) GetHandler

func (mb *MessageBus) GetHandler(channel string) (MessageHandler, bool)

func (*MessageBus) PublishInbound

func (mb *MessageBus) PublishInbound(msg InboundMessage)

func (*MessageBus) PublishOutbound

func (mb *MessageBus) PublishOutbound(msg OutboundMessage)

func (*MessageBus) RegisterHandler

func (mb *MessageBus) RegisterHandler(channel string, handler MessageHandler)

func (*MessageBus) SubscribeOutbound

func (mb *MessageBus) SubscribeOutbound(ctx context.Context) (OutboundMessage, bool)

type MessageHandler

type MessageHandler func(InboundMessage) error

type OutboundMessage

type OutboundMessage struct {
	Channel string `json:"channel"`
	ChatID  string `json:"chat_id"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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