Add support for Kafka as a notifications target (#2869) (#3439)

This commit is contained in:
Aditya Manthramurthy
2016-12-15 21:53:48 +05:30
committed by Harshavardhana
parent 664ff063a1
commit 8e6e9301ce
113 changed files with 16290 additions and 35 deletions
+37
View File
@@ -443,3 +443,40 @@ func loadConfigV9() (*serverConfigV9, error) {
}
return srvCfg, nil
}
// serverConfigV10 server configuration version '10' which is like
// version '9' except it drops support of syslog config, and makes the
// RWMutex global (so it does not exist in this struct).
type serverConfigV10 struct {
Version string `json:"version"`
// S3 API configuration.
Credential credential `json:"credential"`
Region string `json:"region"`
// Additional error logging configuration.
Logger logger `json:"logger"`
// Notification queue configuration.
Notify notifier `json:"notify"`
}
func loadConfigV10() (*serverConfigV10, error) {
configFile, err := getConfigFile()
if err != nil {
return nil, err
}
if _, err = os.Stat(configFile); err != nil {
return nil, err
}
srvCfg := &serverConfigV10{}
srvCfg.Version = "10"
qc, err := quick.New(srvCfg)
if err != nil {
return nil, err
}
if err := qc.Load(configFile); err != nil {
return nil, err
}
return srvCfg, nil
}