add basic plugin architecture

This commit is contained in:
2022-11-01 21:15:32 +01:00
parent e0e0290dcf
commit d484d44981
15 changed files with 150 additions and 28 deletions

View File

@@ -10,9 +10,12 @@ import (
type GoCliPlugin struct {
}
// About implements register.Plugin
func (*GoCliPlugin) About() string {
return "gocli"
func (*GoCliPlugin) About(ctx context.Context) (*register.About, error) {
return &register.About{
Name: "gocli",
Version: "v0.0.1",
About: "golang cli provides a set of actions and presets supporting golang development",
}, nil
}
var _ register.Plugin = &GoCliPlugin{}

32
plugins/rust/main.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"context"
"log"
"git.front.kjuulh.io/kjuulh/char/pkg/register"
)
type GoCliPlugin struct {
}
func (*GoCliPlugin) About(ctx context.Context) (*register.About, error) {
return &register.About{
Name: "rust",
Version: "v0.0.1",
About: "golang cli provides a set of actions and presets supporting golang development",
}, nil
}
var _ register.Plugin = &GoCliPlugin{}
func main() {
if err := register.
NewPluginBuilder(
"rust",
&GoCliPlugin{},
).
Serve(context.Background()); err != nil {
log.Fatal(err)
}
}