-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple "plugin" framework using templates *feature* #3
Comments
I think instead of having built-in support for that, we can actually write a plugin to do that:) We can accept text/template to parse HTTP header/body and translate it into a formatted message. Golang text/template has a relatively lightweight syntax and is easy to get on:) |
Glad you agree |
@jmattheis Do you think we should have a built-in template engine, or it should exist as a plugin is? |
@furyfire Actually we don't need to do so. We can write a single plugin that listens on different URLs for messages, and use different predefined or custom templates to format messages from arbitrary json/plain object. |
Yes and no, some webhooks require validation of the message this would add additional calls which cannot easily be generalized. I agree with @eternal-flame-AD here, lets add a single plugin which supports multiple webhooks / webhook templating. |
Since the Go language natively support a fairly advanced template engine why not allow for "plugins" to be created using templates alone?
https://push.example.de/message?token=&template=github-webhook
Gotify would then parse the incomming JSON and apply the "github-webhook" template.
This would allow for an easy way of using webhooks and quickly parsing out one or two fields.
Just my two cents # #
The text was updated successfully, but these errors were encountered: