mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
f376a2abe3
Unify webhook handling across channel adapters and add the WeChat Official Account channel so inbound routing and replies work without platform-specific handlers. Add adapter-scoped proxy support and stable config field ordering so restricted network environments can deliver WeChat and Telegram messages reliably.
30 lines
901 B
Go
30 lines
901 B
Go
package channel
|
|
|
|
// FieldType enumerates the supported configuration field types.
|
|
type FieldType string
|
|
|
|
const (
|
|
FieldString FieldType = "string"
|
|
FieldSecret FieldType = "secret"
|
|
FieldBool FieldType = "bool"
|
|
FieldNumber FieldType = "number"
|
|
FieldEnum FieldType = "enum"
|
|
)
|
|
|
|
// FieldSchema describes a single configuration field.
|
|
type FieldSchema struct {
|
|
Type FieldType `json:"type"`
|
|
Required bool `json:"required"`
|
|
Order int `json:"order,omitempty"`
|
|
Title string `json:"title,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
Enum []string `json:"enum,omitempty"`
|
|
Example any `json:"example,omitempty"`
|
|
}
|
|
|
|
// ConfigSchema describes the structure of a channel or user-binding configuration.
|
|
type ConfigSchema struct {
|
|
Version int `json:"version"`
|
|
Fields map[string]FieldSchema `json:"fields"`
|
|
}
|