aboutsummaryrefslogtreecommitdiff
path: root/plugin.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-11 15:24:39 +0100
committerSimon Ser <contact@emersion.fr>2019-12-11 15:24:39 +0100
commitf07ab5263246d940fbc1d646bcdb5663398378d0 (patch)
tree3610a240635cbbac0932c359defd2962c05c3d75 /plugin.go
parent1b5bc568fb638314b62ea3d6635de56109680da9 (diff)
downloadalps-f07ab5263246d940fbc1d646bcdb5663398378d0.tar.gz
alps-f07ab5263246d940fbc1d646bcdb5663398378d0.zip
Add docs
Diffstat (limited to 'plugin.go')
-rw-r--r--plugin.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin.go b/plugin.go
index 73f3962..aa964ec 100644
--- a/plugin.go
+++ b/plugin.go
@@ -8,10 +8,17 @@ import (
const pluginDir = "plugins"
+// Plugin extends koushin with additional functionality.
type Plugin interface {
+ // Name should return the plugin name.
Name() string
+ // LoadTemplate populates t with the plugin's functions and templates.
LoadTemplate(t *template.Template) error
+ // SetRoutes populates group with the plugin's routes.
SetRoutes(group *echo.Group)
+ // Inject is called prior to rendering a template. It can extend the
+ // template data by setting new items in the Extra map.
Inject(name string, data interface{}) error
+ // Close is called when the plugin is unloaded.
Close() error
}