Add support for MySQL notifications (fixes #3818) (#3907)

As a new configuration parameter is added, configuration version is
bumped up from 14 to 15.

The MySQL target's behaviour is identical to the PostgreSQL: rows are
deleted from the MySQL table on delete-object events, and are
created/updated on create/over-write events.
This commit is contained in:
Aditya Manthramurthy
2017-03-17 21:59:17 +05:30
committed by Harshavardhana
parent c192e5c9b2
commit 2463ae243a
33 changed files with 5974 additions and 34 deletions
+7
View File
@@ -148,6 +148,10 @@ func isValidQueueID(queueARN string) bool {
pgN := serverConfig.Notify.GetPostgreSQLByID(sqsARN.AccountID)
// Postgres can work with only default conn. info.
return pgN.Enable
} else if isMySQLQueue(sqsARN) {
msqlN := serverConfig.Notify.GetMySQLByID(sqsARN.AccountID)
// Mysql can work with only default conn. info.
return msqlN.Enable
} else if isKafkaQueue(sqsARN) {
kafkaN := serverConfig.Notify.GetKafkaByID(sqsARN.AccountID)
return (kafkaN.Enable && len(kafkaN.Brokers) > 0 &&
@@ -244,6 +248,7 @@ func validateNotificationConfig(nConfig notificationConfig) APIErrorCode {
// - elasticsearch
// - redis
// - postgresql
// - mysql
// - kafka
// - webhook
func unmarshalSqsARN(queueARN string) (mSqs arnSQS) {
@@ -263,6 +268,8 @@ func unmarshalSqsARN(queueARN string) (mSqs arnSQS) {
mSqs.Type = queueTypeRedis
case hasSuffix(sqsType, queueTypePostgreSQL):
mSqs.Type = queueTypePostgreSQL
case hasSuffix(sqsType, queueTypeMySQL):
mSqs.Type = queueTypeMySQL
case hasSuffix(sqsType, queueTypeKafka):
mSqs.Type = queueTypeKafka
case hasSuffix(sqsType, queueTypeWebhook):