Documentation
¶
Index ¶
- type APIResponse
- type Manager
- func (m *Manager) GetSinker(dbName string) (sinker.Sinker, error)
- func (m *Manager) HandleAPI(action string, params map[string]interface{}) APIResponse
- func (m *Manager) HasSQLPlugins() bool
- func (m *Manager) HasWASMPlugins() bool
- func (m *Manager) Init(_ context.Context, db *dbsql.DB, sqlCfg struct{ ... }, ...) error
- func (m *Manager) List() []PluginInfo
- func (m *Manager) ListDatabases() []string
- func (m *Manager) QueryTables(dbName string) ([]string, error)
- func (m *Manager) Stop() error
- func (m *Manager) Transform(ctx context.Context, changes []core.Change, batchCtx *core.BatchContext) error
- func (m *Manager) Unload(name string) error
- type Plugin
- type PluginInfo
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 ¶
NewManager creates a new plugin manager NewManager creates a new plugin manager with optional monitor DB
func (*Manager) HandleAPI ¶
func (m *Manager) HandleAPI(action string, params map[string]interface{}) APIResponse
HandleAPI handles plugin management via HTTP API
func (*Manager) HasSQLPlugins ¶
HasSQLPlugins returns true if any SQL plugins are loaded
func (*Manager) HasWASMPlugins ¶
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) ListDatabases ¶
ListDatabases returns all configured database names from the sink manager
func (*Manager) QueryTables ¶
QueryTables returns the list of tables in a sink database
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).
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)