Flesh out GLoom
I have documented GLoom's new RPC, how a plugin developer might create a plugin, and more. I have also created GLoomI, the included management interface for GLoom and added a LICENSE.
This commit is contained in:
@@ -4,21 +4,17 @@ import "github.com/gofiber/fiber/v3"
|
||||
|
||||
type MyPlugin struct{}
|
||||
|
||||
func (p MyPlugin) Name() string {
|
||||
return "my plugin"
|
||||
}
|
||||
|
||||
func (p MyPlugin) Init() error {
|
||||
func (p *MyPlugin) Init() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p MyPlugin) Domains() []string {
|
||||
return []string{"myplugin.local"}
|
||||
func (p *MyPlugin) Name() string {
|
||||
return "MyPlugin"
|
||||
}
|
||||
|
||||
func (p MyPlugin) RegisterRoutes(router fiber.Router) {
|
||||
func (p *MyPlugin) RegisterRoutes(router fiber.Router) {
|
||||
router.Get("/", func(c fiber.Ctx) error {
|
||||
return c.SendString("Welcome to MyPlugin!")
|
||||
return c.Status(fiber.StatusTeapot).SendString("Welcome to MyPlugin!")
|
||||
})
|
||||
|
||||
router.Get("/hello", func(c fiber.Ctx) error {
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
"author": "you",
|
||||
"license": "BSL-1.0",
|
||||
"scripts": {
|
||||
"build": "go build -buildmode=plugin -o ../plugs/example.so main.go",
|
||||
"dev": "go run main.go"
|
||||
"build": "go build -buildmode=plugin -o plugin.so main.go"
|
||||
},
|
||||
"pattern": "**/*.go",
|
||||
"excluded_dirs": []
|
||||
|
||||
Reference in New Issue
Block a user