plugins

package
v0.0.0-...-b8497f2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalRegistry = NewRegistry()

GlobalRegistry is the global plugin registry.

Functions

This section is empty.

Types

type Plugin

type Plugin interface {
	Name() string
	Version() string
	TranslateQuery(sql string) (string, error)
	ConvertSchema(schema *models.Schema) (*models.Schema, error)
	ExecuteQuery(ctx context.Context, req *proto.ExecuteQueryRequest) (*proto.ExecuteQueryResponse, error)
}

Plugin is the interface that all plugins must implement.

func GetPlugin

func GetPlugin(name string) (Plugin, error)

GetPlugin retrieves a plugin from the global registry by name.

type Registry

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

Registry holds a collection of all registered plugins.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new plugin registry.

func (*Registry) Get

func (r *Registry) Get(name string) (Plugin, bool)

Get retrieves a plugin from the registry by name.

func (*Registry) Register

func (r *Registry) Register(p Plugin)

Register adds a new plugin to the registry.

Directories

Path Synopsis
cmd command

Jump to

Keyboard shortcuts

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