9.3. HSL plugins

Plugins written in HSL should be installed inside a per-plugin folder inside of environment.pluginspath /hsl/example.

/opt/halon/plugins/hsl/
/opt/halon/plugins/hsl/example
/opt/halon/plugins/hsl/example/main.hsl
/opt/halon/plugins/hsl/example/example.hsl

A suggestive structure is to have a main.hsl file which imports (hence export) what should be availabe to the user of the plugin.

import { hello } from "./example.hsl";
function hello()
{
        return "world";
}

The user of the plugin would import it using

import { hello } from "extras://example";

echo hello(); // "world"

If the plugin example.hsl need access to plugin config plugins[].config. It can access the configuration using the following imports. It allows you to build app that consumes the same configuration as native plugins.

import $smtpd from "plugin-config://smtpd.yaml";
import $smtpdapp from "plugin-config://smtpd-app.yaml";