Files
gloom/plugin/main.go
Zoe 98c0f45ca8 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.
2025-01-07 19:35:06 +00:00

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