From e83844fbad63a0d6fc2d29a8a412c95f2a419b56 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 16 Dec 2019 12:26:26 +0100 Subject: Add an API for Go plugins References: https://todo.sr.ht/~sircmpwn/koushin/39 --- plugin.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugin.go') diff --git a/plugin.go b/plugin.go index aa964ec..46fd1a7 100644 --- a/plugin.go +++ b/plugin.go @@ -22,3 +22,10 @@ type Plugin interface { // Close is called when the plugin is unloaded. Close() error } + +var plugins []Plugin + +// RegisterPlugin registers a plugin to be loaded on server startup. +func RegisterPlugin(p Plugin) { + plugins = append(plugins, p) +} -- cgit v1.2.3-59-g8ed1b