Add new webhooks plugin that superseed github and rollbar plugins.
Signed-off-by: François de Metz <francois@stormz.me> Signed-off-by: Cyril Duez <cyril@stormz.me>
This commit is contained in:
16
plugins/inputs/webhooks/webhooks_models/models.go
Normal file
16
plugins/inputs/webhooks/webhooks_models/models.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package webhooks_models
|
||||
|
||||
import (
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/influxdata/telegraf"
|
||||
)
|
||||
|
||||
type Webhook interface {
|
||||
Register(router *mux.Router, acc telegraf.Accumulator)
|
||||
}
|
||||
|
||||
var Webhooks map[string]func(string) Webhook = make(map[string]func(string) Webhook)
|
||||
|
||||
func Add(name string, fun func(string) Webhook) {
|
||||
Webhooks[name] = fun
|
||||
}
|
||||
Reference in New Issue
Block a user