Conversation
4d11e79 to
1b941e4
Compare
|
@jmattheis Would you please leave your review on the plugin interfaces before we moving on to the plugin loader. Thanks. By the way I am not sure if travis can build PR even when there is no |
|
@eternal-flame-AD Thanks for this PR (:. I've enabled travis-ci on this repo so on your next push it should trigger. |
config.go
Outdated
| package plugin | ||
|
|
||
| // Configor is the interface plugins should implement in order to provide configuration interface to the user | ||
| type Configor interface { |
There was a problem hiding this comment.
The Configurer needs a Schema() string method, to provide the schema of the configuration
There was a problem hiding this comment.
Is it possible to just use the default config as the schema?
There was a problem hiding this comment.
We can generate a schema from the struct see https://github.com/alecthomas/jsonschema but I would prefer to use EmptyConfig if #1 (comment) will be done.
|
If I wanted to send messages in webhook, would I create a plugin like this? If yes, I would rename RegisterMessageHandler to SetMessageHandler and RegisterStorageHandler to SetStorageHandler. import (
"github.com/gin-gonic/gin"
"github.com/gotify/plugin-api"
)
type NetlifyWebhooker struct {
msg plugin.MessageHandler
}
var _ plugin.Webhooker = new(NetlifyWebhooker)
var _ plugin.Messenger = new(NetlifyWebhooker)
func (n *NetlifyWebhooker) Enable() error {
return nil
}
func (n *NetlifyWebhooker) Disable() error {
return nil
}
func (n *NetlifyWebhooker) RegisterWebhook(r plugin.WebhookRegisterRequest) {
r.Mux.POST("/netlify", func(context *gin.Context) {
n.msg.SendMessage(plugin.MessageSendRequest{
Message: "hurray",
Title: "something",
})
})
}
func (n *NetlifyWebhooker) RegisterMessageHandler(msg plugin.MessageHandler) {
n.msg = msg
} |
193c6ee to
63394f8
Compare
f2c0995 to
7d76ed5
Compare
798304e to
a2ae569
Compare
|
Okay, after #1 (comment), #1 (comment) and #1 (comment) are done I'd see this PR as mergable. |
55b4dca to
a9368a6
Compare
a9368a6 to
a46fa32
Compare
|
Okay I think this is ready to merge and we can move on to the main PR then. |
TODO: