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.
27 lines
500 B
Go
27 lines
500 B
Go
package main
|
|
|
|
import "github.com/gofiber/fiber/v3"
|
|
|
|
type MyPlugin struct{}
|
|
|
|
func (p *MyPlugin) Init() error {
|
|
return nil
|
|
}
|
|
|
|
func (p *MyPlugin) Name() string {
|
|
return "MyPlugin"
|
|
}
|
|
|
|
func (p *MyPlugin) RegisterRoutes(router fiber.Router) {
|
|
router.Get("/", func(c fiber.Ctx) error {
|
|
return c.Status(fiber.StatusTeapot).SendString("Welcome to MyPlugin!")
|
|
})
|
|
|
|
router.Get("/hello", func(c fiber.Ctx) error {
|
|
return c.SendString("Hello from MyPlugin!")
|
|
})
|
|
}
|
|
|
|
// Exported symbol
|
|
var Plugin MyPlugin
|