mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
Add notifications by webhook.
Add a new config entry moving to version 13.
```
"webhook": {
"1": {
"enable": true,
"address": "http://requestb.in/1i9al7m1"
}
}
```
This commit is contained in:
@@ -40,6 +40,8 @@ const (
|
||||
queueTypePostgreSQL = "postgresql"
|
||||
// Static string indicating queue type 'kafka'.
|
||||
queueTypeKafka = "kafka"
|
||||
// Static string for Webhooks
|
||||
queueTypeWebhook = "webhook"
|
||||
)
|
||||
|
||||
// Topic type.
|
||||
@@ -61,6 +63,7 @@ type notifier struct {
|
||||
Redis map[string]redisNotify `json:"redis"`
|
||||
PostgreSQL map[string]postgreSQLNotify `json:"postgresql"`
|
||||
Kafka map[string]kafkaNotify `json:"kafka"`
|
||||
Webhook map[string]webhookNotify `json:"webhook"`
|
||||
// Add new notification queues.
|
||||
}
|
||||
|
||||
@@ -102,6 +105,18 @@ func isNATSQueue(sqsArn arnSQS) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Returns true if queueArn is for an Webhook queue
|
||||
func isWebhookQueue(sqsArn arnSQS) bool {
|
||||
if sqsArn.Type != queueTypeWebhook {
|
||||
return false
|
||||
}
|
||||
rNotify := serverConfig.GetWebhookNotifyByID(sqsArn.AccountID)
|
||||
if !rNotify.Enable {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Returns true if queueArn is for an Redis queue.
|
||||
func isRedisQueue(sqsArn arnSQS) bool {
|
||||
if sqsArn.Type != queueTypeRedis {
|
||||
|
||||
Reference in New Issue
Block a user