Documentation
¶
Overview ¶
Package adapter provides bridge types that adapt plugin.Runner calls to flowbot's module, ability, and provider registries.
Index ¶
- type PluginAbilityAdapter
- type PluginModuleAdapter
- func (a *PluginModuleAdapter) Bootstrap() error
- func (a *PluginModuleAdapter) Command(ctx types.Context, content any) (types.MsgPayload, error)
- func (a *PluginModuleAdapter) Form(ctx types.Context, values types.KV) (types.MsgPayload, error)
- func (a *PluginModuleAdapter) Help() (map[string][]string, error)
- func (a *PluginModuleAdapter) Init(jsonconf json.RawMessage) error
- func (a *PluginModuleAdapter) Input(ctx types.Context, head types.KV, content any) (types.MsgPayload, error)
- func (a *PluginModuleAdapter) IsReady() bool
- func (a *PluginModuleAdapter) Rules() []any
- func (a *PluginModuleAdapter) SwapRunner(newRunner plugin.Runner)
- func (*PluginModuleAdapter) Webservice(_ *fiber.App)
- type PluginProviderAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginAbilityAdapter ¶
type PluginAbilityAdapter struct {
// contains filtered or unexported fields
}
PluginAbilityAdapter registers Invoker closures for declared operations.
func NewAbilityAdapter ¶
func NewAbilityAdapter(r plugin.Runner, capType string, ops []string) *PluginAbilityAdapter
NewAbilityAdapter creates an ability adapter from a manifest ability declaration.
func (*PluginAbilityAdapter) Register ¶
func (a *PluginAbilityAdapter) Register() error
Register registers all declared operations as ability.Invoker closures.
func (*PluginAbilityAdapter) Unregister ¶
func (a *PluginAbilityAdapter) Unregister()
Unregister removes all registered invokers.
type PluginModuleAdapter ¶
PluginModuleAdapter implements module.Handler by delegating to a Runner.
func NewModuleAdapter ¶
func NewModuleAdapter(m *plugin.Manifest, r plugin.Runner) *PluginModuleAdapter
NewModuleAdapter creates a module adapter for a plugin.
func (*PluginModuleAdapter) Bootstrap ¶
func (a *PluginModuleAdapter) Bootstrap() error
func (*PluginModuleAdapter) Command ¶
func (a *PluginModuleAdapter) Command(ctx types.Context, content any) (types.MsgPayload, error)
func (*PluginModuleAdapter) Form ¶
func (a *PluginModuleAdapter) Form(ctx types.Context, values types.KV) (types.MsgPayload, error)
func (*PluginModuleAdapter) Help ¶
func (a *PluginModuleAdapter) Help() (map[string][]string, error)
func (*PluginModuleAdapter) Init ¶
func (a *PluginModuleAdapter) Init(jsonconf json.RawMessage) error
func (*PluginModuleAdapter) Input ¶
func (a *PluginModuleAdapter) Input(ctx types.Context, head types.KV, content any) (types.MsgPayload, error)
func (*PluginModuleAdapter) IsReady ¶
func (a *PluginModuleAdapter) IsReady() bool
func (*PluginModuleAdapter) Rules ¶
func (a *PluginModuleAdapter) Rules() []any
func (*PluginModuleAdapter) SwapRunner ¶
func (a *PluginModuleAdapter) SwapRunner(newRunner plugin.Runner)
SwapRunner atomically swaps the underlying runner without unregistering.
func (*PluginModuleAdapter) Webservice ¶
func (*PluginModuleAdapter) Webservice(_ *fiber.App)
type PluginProviderAdapter ¶
type PluginProviderAdapter struct {
// contains filtered or unexported fields
}
PluginProviderAdapter implements provider OAuth and webhook interfaces.
func NewProviderAdapter ¶
func NewProviderAdapter(r plugin.Runner, name string) *PluginProviderAdapter
NewProviderAdapter creates a provider adapter.
func (*PluginProviderAdapter) GetAccessToken ¶
func (*PluginProviderAdapter) GetAccessToken(_ fiber.Ctx) (*providers.OAuthToken, error)
GetAccessToken exchanges an authorization code for an access token. Remote plugin providers delegate token exchange to the plugin runner; stub providers return an unimplemented error.
func (*PluginProviderAdapter) GetAuthorizeURL ¶
func (a *PluginProviderAdapter) GetAuthorizeURL(state string) string
GetAuthorizeURL returns the OAuth authorize URL from the plugin.
func (*PluginProviderAdapter) WebhookConvert ¶
func (a *PluginProviderAdapter) WebhookConvert(payload []byte) ([]types.DataEvent, error)
WebhookConvert converts provider webhook payloads to DataEvents.