Documentation
¶
Index ¶
- func CompiledChannelKeys() []string
- type ActionCapable
- type BaseChannel
- func (c *BaseChannel) HandleMessage(senderID, chatID, content string, media []string, metadata map[string]string)
- func (c *BaseChannel) HealthCheck(ctx context.Context) error
- func (c *BaseChannel) IsAllowed(senderID string) bool
- func (c *BaseChannel) IsRunning() bool
- func (c *BaseChannel) Name() string
- type Channel
- type FeishuChannel
- type Manager
- func (m *Manager) CheckHealth(ctx context.Context) map[string]error
- func (m *Manager) GetChannel(name string) (Channel, bool)
- func (m *Manager) GetEnabledChannels() []string
- func (m *Manager) RestartChannel(ctx context.Context, name string) error
- func (m *Manager) SendToChannel(ctx context.Context, channelName, chatID, content string) error
- func (m *Manager) StartAll(ctx context.Context) error
- func (m *Manager) StopAll(ctx context.Context) error
- type TelegramChannel
- func (c *TelegramChannel) HealthCheck(ctx context.Context) error
- func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) error
- func (c *TelegramChannel) Start(ctx context.Context) error
- func (c *TelegramChannel) Stop(ctx context.Context) error
- func (c *TelegramChannel) SupportsAction(action string) bool
- type WeixinAccountSnapshot
- type WeixinChannel
- func (c *WeixinChannel) CancelPendingLogin(loginID string) bool
- func (c *WeixinChannel) ListAccounts() []WeixinAccountSnapshot
- func (c *WeixinChannel) PendingLoginByID(loginID string) *WeixinPendingLogin
- func (c *WeixinChannel) PendingLogins() []*WeixinPendingLogin
- func (c *WeixinChannel) RefreshLoginStatuses(ctx context.Context) ([]*WeixinPendingLogin, error)
- func (c *WeixinChannel) RemoveAccount(botID string) error
- func (c *WeixinChannel) Send(ctx context.Context, msg bus.OutboundMessage) error
- func (c *WeixinChannel) SetConfigPath(path string)
- func (c *WeixinChannel) SetDefaultAccount(botID string) error
- func (c *WeixinChannel) SetPersistHook(fn func(string))
- func (c *WeixinChannel) SnapshotConfig() config.WeixinConfig
- func (c *WeixinChannel) Start(ctx context.Context) error
- func (c *WeixinChannel) StartLogin(ctx context.Context) (*WeixinPendingLogin, error)
- func (c *WeixinChannel) Stop(ctx context.Context) error
- func (c *WeixinChannel) SupportsAction(action string) bool
- type WeixinPendingLogin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompiledChannelKeys ¶
func CompiledChannelKeys() []string
Types ¶
type ActionCapable ¶
ActionCapable is an optional capability interface for channels that support non-send message actions.
type BaseChannel ¶
type BaseChannel struct {
// contains filtered or unexported fields
}
func NewBaseChannel ¶
func NewBaseChannel(name string, config interface{}, bus *bus.MessageBus, allowList []string) *BaseChannel
func (*BaseChannel) HandleMessage ¶
func (c *BaseChannel) HandleMessage(senderID, chatID, content string, media []string, metadata map[string]string)
func (*BaseChannel) HealthCheck ¶
func (c *BaseChannel) HealthCheck(ctx context.Context) error
func (*BaseChannel) IsAllowed ¶
func (c *BaseChannel) IsAllowed(senderID string) bool
func (*BaseChannel) IsRunning ¶
func (c *BaseChannel) IsRunning() bool
func (*BaseChannel) Name ¶
func (c *BaseChannel) Name() string
type FeishuChannel ¶
type FeishuChannel struct {
*BaseChannel
// contains filtered or unexported fields
}
func NewFeishuChannel ¶
func NewFeishuChannel(cfg config.FeishuConfig, bus *bus.MessageBus) (*FeishuChannel, error)
func (*FeishuChannel) Send ¶
func (c *FeishuChannel) Send(ctx context.Context, msg bus.OutboundMessage) error
func (*FeishuChannel) SupportsAction ¶
func (c *FeishuChannel) SupportsAction(action string) bool
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) GetEnabledChannels ¶
func (*Manager) RestartChannel ¶
func (*Manager) SendToChannel ¶
type TelegramChannel ¶
type TelegramChannel struct {
*BaseChannel
// contains filtered or unexported fields
}
func NewTelegramChannel ¶
func NewTelegramChannel(cfg config.TelegramConfig, bus *bus.MessageBus) (*TelegramChannel, error)
func (*TelegramChannel) HealthCheck ¶
func (c *TelegramChannel) HealthCheck(ctx context.Context) error
func (*TelegramChannel) Send ¶
func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) error
func (*TelegramChannel) SupportsAction ¶
func (c *TelegramChannel) SupportsAction(action string) bool
type WeixinAccountSnapshot ¶ added in v1.0.1
type WeixinAccountSnapshot struct {
BotID string `json:"bot_id"`
IlinkUserID string `json:"ilink_user_id,omitempty"`
ContextToken string `json:"context_token,omitempty"`
GetUpdatesBuf string `json:"get_updates_buf,omitempty"`
Connected bool `json:"connected"`
LastEvent string `json:"last_event,omitempty"`
LastError string `json:"last_error,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Default bool `json:"default"`
LastInboundAt string `json:"last_inbound_at,omitempty"`
LastInboundChat string `json:"last_inbound_chat,omitempty"`
LastInboundText string `json:"last_inbound_text,omitempty"`
}
type WeixinChannel ¶ added in v1.0.1
type WeixinChannel struct {
*BaseChannel
// contains filtered or unexported fields
}
func NewWeixinChannel ¶ added in v1.0.1
func NewWeixinChannel(cfg config.WeixinConfig, messageBus *bus.MessageBus) (*WeixinChannel, error)
func (*WeixinChannel) CancelPendingLogin ¶ added in v1.0.1
func (c *WeixinChannel) CancelPendingLogin(loginID string) bool
func (*WeixinChannel) ListAccounts ¶ added in v1.0.1
func (c *WeixinChannel) ListAccounts() []WeixinAccountSnapshot
func (*WeixinChannel) PendingLoginByID ¶ added in v1.0.1
func (c *WeixinChannel) PendingLoginByID(loginID string) *WeixinPendingLogin
func (*WeixinChannel) PendingLogins ¶ added in v1.0.1
func (c *WeixinChannel) PendingLogins() []*WeixinPendingLogin
func (*WeixinChannel) RefreshLoginStatuses ¶ added in v1.0.1
func (c *WeixinChannel) RefreshLoginStatuses(ctx context.Context) ([]*WeixinPendingLogin, error)
func (*WeixinChannel) RemoveAccount ¶ added in v1.0.1
func (c *WeixinChannel) RemoveAccount(botID string) error
func (*WeixinChannel) Send ¶ added in v1.0.1
func (c *WeixinChannel) Send(ctx context.Context, msg bus.OutboundMessage) error
func (*WeixinChannel) SetConfigPath ¶ added in v1.0.1
func (c *WeixinChannel) SetConfigPath(path string)
func (*WeixinChannel) SetDefaultAccount ¶ added in v1.0.1
func (c *WeixinChannel) SetDefaultAccount(botID string) error
func (*WeixinChannel) SetPersistHook ¶ added in v1.0.2
func (c *WeixinChannel) SetPersistHook(fn func(string))
func (*WeixinChannel) SnapshotConfig ¶ added in v1.0.2
func (c *WeixinChannel) SnapshotConfig() config.WeixinConfig
func (*WeixinChannel) Start ¶ added in v1.0.1
func (c *WeixinChannel) Start(ctx context.Context) error
func (*WeixinChannel) StartLogin ¶ added in v1.0.1
func (c *WeixinChannel) StartLogin(ctx context.Context) (*WeixinPendingLogin, error)
func (*WeixinChannel) Stop ¶ added in v1.0.1
func (c *WeixinChannel) Stop(ctx context.Context) error
func (*WeixinChannel) SupportsAction ¶ added in v1.0.1
func (c *WeixinChannel) SupportsAction(action string) bool
type WeixinPendingLogin ¶ added in v1.0.1
type WeixinPendingLogin struct {
LoginID string `json:"login_id,omitempty"`
QRCode string `json:"qr_code,omitempty"`
QRCodeImgContent string `json:"qr_code_img_content,omitempty"`
BaseURL string `json:"base_url,omitempty"`
Status string `json:"status,omitempty"`
LastError string `json:"last_error,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.