This adds a plugin host that seperates plugins from the gloomi process, allowing for plugins to be unloaded and loaded. This commit also has a fair amount of other changes, nice to haves and bug fixes, some notable changes are: - Highly available reverse proxy from my Flux project - Improved gloomi functionality
23 lines
461 B
Go
23 lines
461 B
Go
package main
|
|
|
|
import "github.com/gofiber/fiber/v3"
|
|
|
|
type MyPlugin struct{}
|
|
|
|
func (p *MyPlugin) Init() (*fiber.Config, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (p *MyPlugin) RegisterRoutes(router fiber.Router) {
|
|
router.Get("/", func(c fiber.Ctx) error {
|
|
return c.Status(fiber.StatusOK).SendString("Welcome to MyPlugin!")
|
|
})
|
|
|
|
router.Get("/hello", func(c fiber.Ctx) error {
|
|
return c.SendString("Hello from MyPlugin!")
|
|
})
|
|
}
|
|
|
|
// Exported symbol
|
|
var Plugin MyPlugin
|