add plugin hosts to seperate plugins from gloomi

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
This commit is contained in:
Zoe
2025-05-14 19:31:58 -05:00
parent ad0e949070
commit b8f5bce66c
18 changed files with 852 additions and 239 deletions

View File

@@ -2,6 +2,9 @@
## Plugins
> [!IMPORTANT]
> Plugins __must__ be compiled with the same version of Go that GLoom was compiled with. This is a limitation of Golang's plugin system, which is what GLoom uses to load plugins.
Plugins are the core of GLoom, they are responsible for handling requests and providing routes. When building a plugin, it's expected that all the assets you need will be bundled with the plugin. However, you are allowed to create directories for assets like file uploads, but we urge you to create a specific directory for assets (ie a database or a public directory) to avoid cluttering the root directory of gloom.
### Plugin Interface
@@ -9,7 +12,6 @@ Plugins are the core of GLoom, they are responsible for handling requests and pr
The `Plugin` interface is the main interface for plugins to implement. It has three methods:
- `Init() (*fiber.Config, error)` - This method is called when the plugin is loaded. It is the function that is initially called when the plugin is loaded.
- `Name() string` - This method returns the name of the plugin.
- `RegisterRoutes(router fiber.Router)` - This method is called when the plugin is loaded and is responsible for registering routes to the router.
Furthermore, your plugin should export a symbol named `Plugin` that implements the `Plugin` interface. The easiest way to do this in Go is simply