aboutsummaryrefslogtreecommitdiffstats
path: root/template.go
diff options
context:
space:
mode:
authorLibravatarLibravatar Simon Ser <[email protected]> 2019-12-17 15:14:15 +0100
committerLibravatarLibravatar Simon Ser <[email protected]> 2019-12-17 15:14:36 +0100
commit020e27fe459b0ed66a48b46cb2878520ed4a517b (patch)
tree9de95206d06bd9654cb5e40e81902e7b77cafedc /template.go
parentca3672df2ad75cbb866b08ca79320a75e30a55ce (diff)
downloadalps-020e27fe459b0ed66a48b46cb2878520ed4a517b.tar.gz
alps-020e27fe459b0ed66a48b46cb2878520ed4a517b.tar.bz2
alps-020e27fe459b0ed66a48b46cb2878520ed4a517b.zip
Add Context to Plugin.Inject
This allows to access the request metadata and the session from injectors.
Diffstat (limited to 'template.go')
-rw-r--r--template.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/template.go b/template.go
index 6286e08..4b46d84 100644
--- a/template.go
+++ b/template.go
@@ -87,7 +87,7 @@ func (r *renderer) Render(w io.Writer, name string, data interface{}, ectx echo.
ctx := ectx.Get("context").(*Context)
for _, plugin := range ctx.Server.Plugins {
- if err := plugin.Inject(name, data.(RenderData)); err != nil {
+ if err := plugin.Inject(ctx, name, data.(RenderData)); err != nil {
return fmt.Errorf("failed to run plugin '%v': %v", plugin.Name(), err)
}
}