11package dynamic_plugins
22
33import (
4- "github.com/gin-gonic/gin"
4+ "github.com/gin-gonic/gin"
55)
66
77// PluginMetadata contains plugin information
88type PluginMetadata struct {
9- ID string `yaml:"id"`
10- Name string `yaml:"name"`
11- Version string `yaml:"version"`
12- Description string `yaml:"description"`
13- Author string `yaml:"author"`
14- Endpoints []EndpointConfig `yaml:"endpoints"`
15- Dependencies []string `yaml:"dependencies"`
16- Permissions []string `yaml:"permissions"`
17- Compatibility map [string ]string `yaml:"compatibility"`
9+ ID string `yaml:"id"`
10+ Name string `yaml:"name"`
11+ Version string `yaml:"version"`
12+ Description string `yaml:"description"`
13+ Author string `yaml:"author"`
14+ Endpoints []EndpointConfig `yaml:"endpoints"`
15+ Dependencies []string `yaml:"dependencies"`
16+ Permissions []string `yaml:"permissions"`
17+ Compatibility map [string ]string `yaml:"compatibility"`
1818}
1919
2020// EndpointConfig defines plugin endpoint configuration
2121type EndpointConfig struct {
22- Path string `yaml:"path"`
23- Method string `yaml:"method"`
24- Handler string `yaml:"handler"`
22+ Path string `yaml:"path"`
23+ Method string `yaml:"method"`
24+ Handler string `yaml:"handler"`
2525}
2626
2727// KubestellarPlugin defines the interface that all dynamic plugins must implement
2828type KubestellarPlugin interface {
29- Initialize (config map [string ]interface {}) error
30- GetMetadata () PluginMetadata
31- GetHandlers () map [string ]gin.HandlerFunc
32- Health () error
33- Cleanup () error
29+ Initialize (config map [string ]interface {}) error
30+ GetMetadata () PluginMetadata
31+ GetHandlers () map [string ]gin.HandlerFunc
32+ Health () error
33+ Cleanup () error
3434}
3535
3636// PluginSymbol is the required symbol name in plugin .so files
3737const PluginSymbol = "NewPlugin"
3838
3939// NewPluginFunc is the function signature for creating new plugin instances
40- type NewPluginFunc func () KubestellarPlugin
40+ type NewPluginFunc func () KubestellarPlugin
0 commit comments