diff --git a/service/CrawlerService.go b/service/CrawlerService.go index a7d0395..e82b541 100644 --- a/service/CrawlerService.go +++ b/service/CrawlerService.go @@ -47,7 +47,7 @@ func (s *CrawlerService) DestroyService() { } -func (s *CrawlerService) Auth(crawlerName string, auth map[string]string) error { +func (s *CrawlerService) Auth(crawlerName string, auth map[string]interface{}) error { _crawler, ok := s.Crawlers[crawlerName] if !ok { return fmt.Errorf("There is no crawler[%s]", crawlerName) diff --git a/service/SensorConfigService.go b/service/SensorConfigService.go index b4c02d6..09fa7a1 100644 --- a/service/SensorConfigService.go +++ b/service/SensorConfigService.go @@ -63,13 +63,13 @@ func (s *SensorConfigService) AddConfig(sensorConfig *ocsm.SensorConfig) error { return fmt.Errorf("Sensor config is not valid") } - sensorConfigID := sensorConfig.ConfigID - if _, ok := s.sensorConfigs[sensorConfigID]; ok { - return fmt.Errorf("Sensor config[%s] is exist already", sensorConfigID) + configID := sensorConfig.ConfigID + if _, ok := s.sensorConfigs[configID]; ok { + return fmt.Errorf("Sensor config[%s] is exist already", configID) } - s.sensorConfigs[sensorConfigID] = sensorConfig + s.sensorConfigs[configID] = sensorConfig - logging.Logger().Debugf("Sensor config[%d] was added", sensorConfigID) + logging.Logger().Debugf("Sensor config[%s] was added", configID) return nil } @@ -79,14 +79,14 @@ func (s *SensorConfigService) UpdateConfig(sensorConfig *ocsm.SensorConfig) erro return fmt.Errorf("Sensor config is not valid") } - sensorConfigID := sensorConfig.ConfigID - if _, ok := s.sensorConfigs[sensorConfigID]; !ok { - return fmt.Errorf("Sensor config[%s] is not exist", sensorConfigID) + configID := sensorConfig.ConfigID + if _, ok := s.sensorConfigs[configID]; !ok { + return fmt.Errorf("Sensor config[%s] is not exist", configID) } - delete(s.sensorConfigs, sensorConfigID) - s.sensorConfigs[sensorConfigID] = sensorConfig + delete(s.sensorConfigs, configID) + s.sensorConfigs[configID] = sensorConfig - logging.Logger().Debugf("Sensor config[%d] was updated", sensorConfigID) + logging.Logger().Debugf("Sensor config[%s] was updated", configID) return nil }