Documentation
¶
Overview ¶
Package platform defines adapter contracts and platform-neutral outbound messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommunityManagement ¶
type CommunityManagement interface {
GetCommunity(ctx context.Context, id string) (Community, error)
GetMembers(ctx context.Context, communityID string) ([]Member, error)
}
CommunityManagement exposes optional community lookup operations.
type Dispatcher ¶
Dispatcher accepts normalized events from adapters.
type MessageEditor ¶
type MessageEditor interface {
Edit(ctx context.Context, ev event.Event, msg OutgoingMessage) error
}
MessageEditor is an optional platform capability for editing the message related to an incoming event (typically callback events).
type MessageEditorByRef ¶
type MessageEditorByRef interface {
EditByRef(ctx context.Context, ref MessageRef, msg OutgoingMessage) error
}
MessageEditorByRef is an optional platform capability for editing messages via explicit message references.
type MessageRef ¶
type MessageRef = event.MessageRef
MessageRef is a platform-agnostic reference to an existing message. Platforms may use different fields depending on capabilities.
type MessageSenderWithRef ¶
type MessageSenderWithRef interface {
SendWithRef(ctx context.Context, target Target, msg OutgoingMessage) (MessageRef, error)
}
MessageSenderWithRef is an optional platform capability for sending messages and returning a reference that can be used for later edits.
type Migratable ¶
type OutgoingMessage ¶
type OutgoingMessage struct {
Text string
Keyboard *keyboard.Keyboard
Attachments []attachments.Attachment
ReplyTo *MessageRef
Raw any
}
OutgoingMessage contains portable message content and optional native data.
type Platform ¶
type Platform interface {
Name() string
Capabilities() capability.Capabilities
Start(ctx context.Context, dispatcher Dispatcher) error
Send(ctx context.Context, target Target, msg OutgoingMessage) error
AnswerCallback(ctx context.Context, callbackID string, text string) error
Raw() any
}
Platform is implemented by every concrete messaging adapter.