plugin

package
v0.0.0-...-77b25ca Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Success bool        `json:"success"`
	Error   string      `json:"error,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

APIResponse is the response format for plugin API

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages SQL plugins.

func NewManager

func NewManager(monitorDB *monitor.DB) *Manager

NewManager creates a new plugin manager NewManager creates a new plugin manager with optional monitor DB

func (*Manager) GetSinker

func (m *Manager) GetSinker(dbName string) (sinker.Sinker, error)

GetSinker returns a Sinker for the given database name

func (*Manager) HandleAPI

func (m *Manager) HandleAPI(action string, params map[string]interface{}) APIResponse

HandleAPI handles plugin management via HTTP API

func (*Manager) HasSQLPlugins

func (m *Manager) HasSQLPlugins() bool

HasSQLPlugins returns true if any SQL plugins are loaded

func (*Manager) HasWASMPlugins

func (m *Manager) HasWASMPlugins() bool

HasWASMPlugins returns true if any WASM plugins are loaded

func (*Manager) Init

func (m *Manager) Init(_ context.Context, db *dbsql.DB, sqlCfg struct {
	Enabled bool
	Path    string
}, dbConfigs map[string]config.SinkConfig) error

Init initializes all SQL plugins based on the provided config.

func (*Manager) List

func (m *Manager) List() []PluginInfo

List returns all loaded plugins

func (*Manager) ListDatabases

func (m *Manager) ListDatabases() []string

ListDatabases returns all configured database names from the sink manager

func (*Manager) QueryTables

func (m *Manager) QueryTables(dbName string) ([]string, error)

QueryTables returns the list of tables in a sink database

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stops all plugins and releases resources

func (*Manager) Transform

func (m *Manager) Transform(ctx context.Context, changes []core.Change, batchCtx *core.BatchContext) error

Transform processes a batch of changes through all SQL plugins with pull context. BatchCtx provides batch_id for observability logging. Skill logs are written by the engine for each skill (per skill × operation). Sink logs are written by the sinker for each sink write (per sink × table × operation). Returns error if no SQL plugin is loaded (no skill pipeline available).

func (*Manager) Unload

func (m *Manager) Unload(name string) error

Unload unloads a plugin by name

type Plugin

type Plugin interface {
	// Name returns the plugin name
	Name() string

	// Type returns the plugin type: "sql"
	Type() string

	// Stop stops the plugin and releases resources.
	Stop() error
}

Plugin is the common interface for SQL plugins.

Go naming convention: noun phrase, no -er suffix for multi-method interfaces. Note: Init/Start are handled internally by each plugin type's constructor; only Stop is called through this interface.

type PluginInfo

type PluginInfo struct {
	Name     string    `json:"name"` // YAML name field
	Id       string    `json:"id"`   // SHA256(file)[:12]
	File     string    `json:"file"` // Relative file path
	Path     string    `json:"path"`
	LoadedAt time.Time `json:"loaded_at"`
	Type     string    `json:"type"` // "sql"
}

PluginInfo contains plugin metadata (used by API)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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