-
Notifications
You must be signed in to change notification settings - Fork 3
Plugins (Beta)
Currently Beta! Use it with Caution
Fluere offers a plugin system that allows users to extend its functionality according to their specific needs. This guide will walk you through how to use existing plugins and develop new ones for Fluere.
Using plugins in Fluere is a straightforward process. Plugins are managed through the fluere.toml
configuration file, which is located at /.config/fluere/fluere.toml
or /Library/Application Support/fluere/fluere.toml
or \AppData\Roaming\fluere\fluere.toml
, which it is depends on your operating system.
In this file, you can specify which plugins to enable, provide extra arguments, or specify a path if the plugin is not hosted on GitHub.
Here is an example of how to configure plugins in the fluere.toml
file:
[plugins]
"SkuldNorniern/plugin.fluere" = { enabled = false, path = "/home/user/dir/plugin.fluere", extra_arguments = { "api_key" = "-", "app_key" = "-"}}
"SkuldNorniern/reportgen.fluere" = { enabled = true }
In the above configuration:
- The plugin name follows the format
GitHubUser/Repo
. - The
enabled
field indicates whether the plugin is active. - The
extra_arguments
field allows you to pass additional parameters to the plugin. - If the plugin is not hosted on GitHub, specify the
path
field to point to the location of the plugin files.
Developing a plugin for Fluere involves creating a Lua script with specific functions that Fluere can call during its operation. Here is the basic structure of a Fluere plugin:
local plugin = {}
function plugin.init(config)
-- Initialization code here
end
function plugin.process_data(data)
-- Data processing code here
end
function plugin.cleanup()
-- Cleanup code here
end
return plugin
In this structure:
-
plugin.init(config)
: This function is called when the plugin is initialized, and it receives the configuration parameters as an argument. -
plugin.process_data(data)
: This function is called to process data, with the data being passed as an argument. -
plugin.cleanup()
: This function is called when the plugin needs to clean up resources before exiting.
- Setup: Create a new Lua file and define the plugin structure as shown above.
-
Initialization: Implement the
plugin.init(config)
function to initialize your plugin with the necessary configuration. -
Data Processing: Implement the
plugin.process_data(data)
function to define how your plugin should process data. -
Cleanup: Implement the
plugin.cleanup()
function to clean up any resources used by your plugin before it exits. - Testing: Test your plugin thoroughly to ensure it works correctly with Fluere.
-
Deployment: Deploy your plugin to GitHub or another accessible location, and update the
fluere.toml
file to include your plugin configuration.
- SkuldNorniern/reportgen.fluere: Generate Detailed Connection Info Live, (at a .txt file)
- SkuldNorniern/datadog.fluere: datadog metrics plugin,
Plugins are a powerful way to extend the functionality of Fluere, allowing for customized network monitoring and analysis solutions. Whether you are using existing plugins or developing your own, the plugin system provides a flexible framework to enhance Fluere's capabilities.
Feel free to explore the world of Fluere plugins and contribute to the community by developing and sharing your plugins!