Documentation
¶
Index ¶
- type Button
- type InboundMessage
- type MediaItem
- type MessageBus
- func (mb *MessageBus) Close()
- func (mb *MessageBus) ConsumeInbound(ctx context.Context) (InboundMessage, bool)
- func (mb *MessageBus) GetHandler(channel string) (MessageHandler, bool)
- func (mb *MessageBus) PublishInbound(msg InboundMessage)
- func (mb *MessageBus) PublishOutbound(msg OutboundMessage)
- func (mb *MessageBus) RegisterHandler(channel string, handler MessageHandler)
- func (mb *MessageBus) SubscribeOutbound(ctx context.Context) (OutboundMessage, bool)
- type MessageHandler
- type OutboundMessage
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"`
MediaItems []MediaItem `json:"media_items,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"`
Media string `json:"media,omitempty"`
ReplyToID string `json:"reply_to_id,omitempty"`
ReplyToSender string `json:"reply_to_sender,omitempty"`
Buttons [][]Button `json:"buttons,omitempty"`
Action string `json:"action,omitempty"`
MessageID string `json:"message_id,omitempty"`
Emoji string `json:"emoji,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.