Documentation
¶
Overview ¶
Package channel defines the interface that every messaging adapter must implement, along with a registry for managing active channels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel interface {
// Name returns the unique identifier of this channel (e.g. "telegram").
Name() string
// Manifest describes the capabilities supported by this channel.
Manifest() Manifest
// Send delivers an outbound Envelope through the channel.
Send(ctx context.Context, env *envelope.Envelope) error
// Receive returns a read-only channel that emits inbound Envelopes.
// The caller must respect context cancellation.
Receive(ctx context.Context) (<-chan *envelope.Envelope, error)
}
Channel is the contract for a messaging adapter. Each adapter converts between its native protocol and the canonical Envelope type.
type Manifest ¶
type Manifest struct {
Text bool `json:"text"`
Image bool `json:"image"`
Audio bool `json:"audio"`
Video bool `json:"video"`
Buttons bool `json:"buttons"`
}
Manifest declares which content types a channel supports.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages a set of active channels, allowing registration, lookup, removal, and listing. It is safe for concurrent use.
func (*Registry) Get ¶
Get returns the channel with the given name and true, or nil and false if not found.
func (*Registry) Unregister ¶
Unregister removes a channel from the registry by name.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package console is the internal direct-chat channel (operator-console spec FR-CONS-1): a first-class channel.Channel with NO network — the operator talks to the brains from the app itself.
|
Package console is the internal direct-chat channel (operator-console spec FR-CONS-1): a first-class channel.Channel with NO network — the operator talks to the brains from the app itself. |
|
Package discord is the Discord channel adapter (Piece 4, ADR-0033).
|
Package discord is the Discord channel adapter (Piece 4, ADR-0033). |
|
Package telegram is the Korvun channel adapter for Telegram Bot updates.
|
Package telegram is the Korvun channel adapter for Telegram Bot updates. |
|
Package webhook implements a generic webhook channel adapter that converts arbitrary JSON payloads into Envelopes using a configurable field mapping.
|
Package webhook implements a generic webhook channel adapter that converts arbitrary JSON payloads into Envelopes using a configurable field mapping. |
Click to show internal directories.
Click to hide internal directories.