Webhooks plugin: add mandrill (#1408)
* Add mandrill webhook. * Store the id of the msg as part of event. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Decode body to get the mandrill_events. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Handle HEAD request. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Add the README. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Add mandrill_webhooks to the README. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Update changelog. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me> * Run gofmt. Signed-off-by: Cyril Duez <cyril@stormz.me> Signed-off-by: François de Metz <francois@stormz.me>
This commit is contained in:
committed by
Cameron Sparr
parent
5dc4cce157
commit
1c2965703d
24
plugins/inputs/webhooks/mandrill/mandrill_webhooks_events.go
Normal file
24
plugins/inputs/webhooks/mandrill/mandrill_webhooks_events.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package mandrill
|
||||
|
||||
type Event interface {
|
||||
Tags() map[string]string
|
||||
Fields() map[string]interface{}
|
||||
}
|
||||
|
||||
type MandrillEvent struct {
|
||||
EventName string `json:"event"`
|
||||
TimeStamp int64 `json:"ts"`
|
||||
Id string `json:"_id"`
|
||||
}
|
||||
|
||||
func (me *MandrillEvent) Tags() map[string]string {
|
||||
return map[string]string{
|
||||
"event": me.EventName,
|
||||
}
|
||||
}
|
||||
|
||||
func (me *MandrillEvent) Fields() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"id": me.Id,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user