Documentation
¶
Overview ¶
Package chat_apps provides multi-platform chat app integration for DivineSense. Supported platforms: Telegram, WhatsApp (via Baileys bridge), DingTalk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
ID int64
UserID int32
Platform Platform
PlatformUserID string
PlatformChatID string
AccessToken string // Encrypted at rest
AppSecret string // Encrypted at rest (e.g., DingTalk AppSecret)
WebhookURL string // For DingTalk
Enabled bool
CreatedTs int64
UpdatedTs int64
}
Credential represents a stored chat app credential.
type IncomingMessage ¶
type IncomingMessage struct {
Platform Platform // Source platform
PlatformUserID string // Platform-specific user ID
PlatformChatID string // Platform-specific chat ID
Type MessageType // Message type
Content string // Text content
MediaURL string // URL for media download
MediaData []byte // Downloaded media data
FileName string // Original filename
MimeType string // MIME type
Metadata map[string]string // Additional platform-specific metadata
Timestamp time.Time // Message timestamp
}
IncomingMessage represents a message from a chat platform.
type MessageType ¶
type MessageType int
MessageType represents the type of message.
const ( MessageTypeText MessageType = iota MessageTypePhoto MessageTypeAudio MessageTypeVideo MessageTypeDocument )
func (MessageType) String ¶
func (m MessageType) String() string
String returns the string representation of MessageType.
type OutgoingMessage ¶
type OutgoingMessage struct {
PlatformChatID string // Destination chat ID
Type MessageType // Message type
Content string // Text content
MediaData []byte // Media data for non-text messages
MimeType string // MIME type of media
FileName string // Original filename
ParseMode string // Markdown/HTML parsing mode (optional)
}
OutgoingMessage represents a message to send to a chat platform.
type WebhookInfo ¶
type WebhookInfo struct {
URL string // The webhook URL
SetupInstructions string // Human-readable setup instructions
Headers map[string]string // Required headers for verification
RequiresVerification bool // Whether signature verification is required
}
WebhookInfo contains webhook setup information for a platform.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package channels provides the ChatChannel interface for all chat platform integrations.
|
Package channels provides the ChatChannel interface for all chat platform integrations. |
|
dingtalk
Package dingtalk provides cryptographic utilities for DingTalk.
|
Package dingtalk provides cryptographic utilities for DingTalk. |
|
telegram
Package telegram implements the Telegram Bot channel.
|
Package telegram implements the Telegram Bot channel. |
|
whatsapp
Package whatsapp implements WhatsApp integration via Baileys Node.js bridge.
|
Package whatsapp implements WhatsApp integration via Baileys Node.js bridge. |
|
Package media provides multimedia processing for chat apps.
|
Package media provides multimedia processing for chat apps. |
|
Package metrics provides webhook health monitoring for chat apps.
|
Package metrics provides webhook health monitoring for chat apps. |
|
Package store provides cryptographic utilities for secure token storage.
|
Package store provides cryptographic utilities for secure token storage. |
Click to show internal directories.
Click to hide internal directories.