Skip to content

Commit cc6f7b2

Browse files
Ishaan SoniIshaan Soni
authored andcommitted
feat: integrate task-plugin functionality
- Merge all task-plugin features into plugins branch - Add enhanced plugin management capabilities - Consolidate changes into single commit for clean history
1 parent 86e81b3 commit cc6f7b2

26 files changed

Lines changed: 6445 additions & 120 deletions

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ backend/secret.yml
138138
backend/backend
139139
backend/vendor/
140140

141-
142141
# history file
143142
.history/
144143

145144
#Temproary log testing for Import Clusters
146145
db.json
147146

148147
#Personal text file
149-
ExtraCode.md
148+
ExtraCode.md
149+
150+
# Compiled plugin binaries (large files)
151+
*.so
152+
backend/dynamic_plugins/cache/
153+
backend/example_plugins/**/*.so
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package dynamic_plugins
2+
3+
import (
4+
"github.com/gin-gonic/gin"
5+
)
6+
7+
// PluginMetadata contains plugin information
8+
type 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"`
18+
}
19+
20+
// EndpointConfig defines plugin endpoint configuration
21+
type EndpointConfig struct {
22+
Path string `yaml:"path"`
23+
Method string `yaml:"method"`
24+
Handler string `yaml:"handler"`
25+
}
26+
27+
// KubestellarPlugin defines the interface that all dynamic plugins must implement
28+
type KubestellarPlugin interface {
29+
Initialize(config map[string]interface{}) error
30+
GetMetadata() PluginMetadata
31+
GetHandlers() map[string]gin.HandlerFunc
32+
Health() error
33+
Cleanup() error
34+
}
35+
36+
// PluginSymbol is the required symbol name in plugin .so files
37+
const PluginSymbol = "NewPlugin"
38+
39+
// NewPluginFunc is the function signature for creating new plugin instances
40+
type NewPluginFunc func() KubestellarPlugin

0 commit comments

Comments
 (0)