965cce7192
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
25 lines
666 B
Go
25 lines
666 B
Go
package bridge
|
|
|
|
import "context"
|
|
|
|
// PlatformAdapter is the interface every platform adapter must implement.
|
|
type PlatformAdapter interface {
|
|
PlatformName() string
|
|
|
|
// Message conversion.
|
|
ToUnified(rawMessage interface{}) (*UnifiedMessage, error)
|
|
FromUnified(response *UnifiedResponse) ([]PlatformMessage, error)
|
|
|
|
// Capabilities.
|
|
Capabilities() PlatformCapabilities
|
|
|
|
// Connection management.
|
|
Connect(ctx context.Context) error
|
|
Disconnect(ctx context.Context) error
|
|
IsConnected() bool
|
|
HealthCheck() error
|
|
}
|
|
|
|
// MessageHandler receives unified messages from adapters for processing.
|
|
type MessageHandler func(msg *UnifiedMessage) (*UnifiedResponse, error)
|