Plugins
Last updated
Was this helpful?
Last updated
Was this helpful?
Janus can be extended with plugins. Plugins add missing functionality to Janus. They are "plugged in" at compile-time. The plugins are attached to an and you can enable or disable them at any time.
Janus comes with a set of built in plugins that you can add to your API Definitions:
Even though there are different kinds of plugins, the process of creating one is roughly the same for all.
Start a new Go package with an init function and register your plugin with Janus:
Every plugin must have a name and, when applicable, the name must be unique.
Write tests. Get good coverage where possible, and make sure your assertions test what you think they are testing! Use go vet and go test -race to ensure your plugin is as error-free as possible.
People will use plugins that are useful, clearly documented, easy to use, and maintained by their owner. And congratulations, you're a Janus plugin author!
To plug your plugin into Janus, import it. This is usually done near the top of :