Retrieve function logs from controller (#207)
Establish a proxy server from the controller to the log database. Redirect query commands send from client to database then proxy back the db response. Use parameter binding instead of fmt.Sprintf to prevent SQL injection.
This commit is contained in:
committed by
Soam Vasani
parent
531f69a037
commit
990d943f21
+4
-13
@@ -49,20 +49,11 @@ type LogEntry struct {
|
||||
Pod string
|
||||
}
|
||||
|
||||
type DBConfig struct {
|
||||
DBType string
|
||||
Endpoint string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
func GetLogDB(cnf DBConfig) (LogDatabase, error) {
|
||||
switch cnf.DBType {
|
||||
func GetLogDB(dbType string, serverURL string) (LogDatabase, error) {
|
||||
switch dbType {
|
||||
case INFLUXDB:
|
||||
return NewInfluxDB(cnf)
|
||||
return NewInfluxDB(serverURL)
|
||||
}
|
||||
log.WithFields(log.Fields{
|
||||
"FISSION_LOGDB_URL": cnf.Endpoint,
|
||||
}).Fatalf("FISSION_LOGDB_URL is incorrect, now only support %s", INFLUXDB)
|
||||
log.Fatalf("Log database type is incorrect, now only support %s", INFLUXDB)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user