mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 06:00:24 +03:00
Support access format for database notification targets (#3953)
* Add configuration parameter "format" for db targets and perform configuration migration. * Add PostgreSQL `access` format: This causes Minio to append all events to the configured table. Prefix, suffix and event filters continue to be supported for this mode too. * Update documentation for PostgreSQL notification target. * Add MySQL `access` format: It is very similar to the same format for PostgreSQL. * Update MySQL notification documentation.
This commit is contained in:
committed by
Harshavardhana
parent
6e63904048
commit
a099319e66
@@ -19,6 +19,7 @@ package cmd
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
@@ -29,6 +30,7 @@ import (
|
||||
// elasticQueue is a elasticsearch event notification queue.
|
||||
type elasticSearchNotify struct {
|
||||
Enable bool `json:"enable"`
|
||||
Format string `json:"format"`
|
||||
URL string `json:"url"`
|
||||
Index string `json:"index"`
|
||||
}
|
||||
@@ -37,6 +39,11 @@ func (e *elasticSearchNotify) Validate() error {
|
||||
if !e.Enable {
|
||||
return nil
|
||||
}
|
||||
if e.Format != formatNamespace {
|
||||
return fmt.Errorf(
|
||||
"Elasticsearch Notifier Error: \"format\" must be \"%s\"",
|
||||
formatNamespace)
|
||||
}
|
||||
if _, err := checkURL(e.URL); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user