Documentation
¶
Overview ¶
Package plugins provides a framework for dynamically loading and managing plugins
Index ¶
- func LoadPlugins(config *Config) ([]schemas.Plugin, error)
- type Config
- type DynamicPlugin
- func (dp *DynamicPlugin) Cleanup() error
- func (dp *DynamicPlugin) GetName() string
- func (dp *DynamicPlugin) HTTPTransportMiddleware() schemas.BifrostHTTPMiddleware
- func (dp *DynamicPlugin) PostHook(ctx *schemas.BifrostContext, resp *schemas.BifrostResponse, ...) (*schemas.BifrostResponse, *schemas.BifrostError, error)
- func (dp *DynamicPlugin) PreHook(ctx *schemas.BifrostContext, req *schemas.BifrostRequest) (*schemas.BifrostRequest, *schemas.PluginShortCircuit, error)
- type DynamicPluginConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Plugins []DynamicPluginConfig `json:"plugins"`
}
Config is the configuration for the plugins framework
type DynamicPlugin ¶
type DynamicPlugin struct {
Enabled bool
Path string
Config any
// contains filtered or unexported fields
}
DynamicPlugin is the interface for a dynamic plugin
func (*DynamicPlugin) Cleanup ¶
func (dp *DynamicPlugin) Cleanup() error
Cleanup is not used for dynamic plugins
func (*DynamicPlugin) GetName ¶
func (dp *DynamicPlugin) GetName() string
GetName returns the name of the plugin
func (*DynamicPlugin) HTTPTransportMiddleware ¶ added in v1.2.0
func (dp *DynamicPlugin) HTTPTransportMiddleware() schemas.BifrostHTTPMiddleware
HTTPTransportMiddleware returns the HTTP transport middleware function for this plugin
func (*DynamicPlugin) PostHook ¶
func (dp *DynamicPlugin) PostHook(ctx *schemas.BifrostContext, resp *schemas.BifrostResponse, bifrostErr *schemas.BifrostError) (*schemas.BifrostResponse, *schemas.BifrostError, error)
PostHook is not used for dynamic plugins
func (*DynamicPlugin) PreHook ¶
func (dp *DynamicPlugin) PreHook(ctx *schemas.BifrostContext, req *schemas.BifrostRequest) (*schemas.BifrostRequest, *schemas.PluginShortCircuit, error)
PreHook is not used for dynamic plugins
Click to show internal directories.
Click to hide internal directories.