plugins

package
v1.1.32 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package plugins provides a framework for dynamically loading and managing plugins

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPlugins

func LoadPlugins(config *Config) ([]schemas.Plugin, error)

LoadPlugins loads the plugins from the config

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) PostHook

PostHook is not used for dynamic plugins

func (*DynamicPlugin) PreHook

PreHook is not used for dynamic plugins

func (*DynamicPlugin) TransportInterceptor

func (dp *DynamicPlugin) TransportInterceptor(ctx *context.Context, url string, headers map[string]string, body map[string]any) (map[string]string, map[string]any, error)

TransportInterceptor is not used for dynamic plugins

type DynamicPluginConfig

type DynamicPluginConfig struct {
	Path    string `json:"path"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Config  any    `json:"config"`
}

Jump to

Keyboard shortcuts

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