Documentation
¶
Index ¶
- func Enrich(pluginsCfg map[string]any, schema *huma.OpenAPI) (*huma.OpenAPI, error)
- func Plugins[TPlugin Plugin](pluginsCfg map[string]any) ([]TPlugin, error)
- func Register[TConfig Config, TPlugin Plugin](f PluginF[TConfig, TPlugin])
- func Routes(pluginsCfg map[string]any, mux *http.ServeMux) error
- func Wrap(pluginsCfg map[string]any, connector connectors.Connector) (connectors.Connector, error)
- type Config
- type HTTPServer
- type Interceptor
- type MCPToolEnricher
- type MCPTooler
- type Plugin
- type PluginF
- type Swaggerer
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
func Wrap(pluginsCfg map[string]any, connector connectors.Connector) (connectors.Connector, error)
Types ¶
type Config ¶
type Config interface {
// Tag returns the unique identifier for the plugin
Tag() string
Doc() string
}
Config defines the basic configuration interface that all plugin configs must implement
func KnownPlugin ¶
KnownPlugin returns configuration for a specific plugin by tag
func KnownPlugins ¶
func KnownPlugins() []Config
KnownPlugins returns a list of all registered plugin configurations
type HTTPServer ¶
type Interceptor ¶
type Interceptor interface {
Plugin
// Process handles the data transformation and returns processed data and a skip flag
// data: the input data to be processed
// context: additional context information as key-value pairs
// Returns: processed data and a boolean indicating if further processing should be skipped
Process(data map[string]any, context map[string][]string) (procesed map[string]any, skipped bool)
}
Interceptor represents a plugin that can process and modify data before it reaches the connector
type MCPToolEnricher ¶ added in v0.2.7
type Plugin ¶
type Plugin interface {
// Doc returns the documentation string describing plugin's purpose and configuration
Doc() string
}
Plugin is the base interface that all plugins must implement
type Swaggerer ¶
type Swaggerer interface {
Plugin
// Enrich enhances the OpenAPI documentation with additional specifications
// Returns: modified OpenAPI documentation
Enrich(swag *huma.OpenAPI) *huma.OpenAPI
}
Swaggerer represents a plugin that can modify OpenAPI documentation
type Wrapper ¶
type Wrapper interface {
Plugin
// Wrap takes a connector and returns an enhanced version of it
// Returns: wrapped connector or error if wrapping fails
Wrap(connector connectors.Connector) (connectors.Connector, error)
}
Wrapper represents a plugin that can wrap and enhance a connector's functionality
Click to show internal directories.
Click to hide internal directories.