adapter

package
v0.92.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package adapter provides bridge types that adapt plugin.Runner calls to flowbot's module, ability, and provider registries.

Index

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

type PluginModuleAdapter struct {
	module.Base
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL