This commit is contained in:
crusader 2018-04-23 19:21:10 +09:00
parent a5a918287b
commit bd3b3f578e
2 changed files with 12 additions and 12 deletions

View File

@ -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] _crawler, ok := s.Crawlers[crawlerName]
if !ok { if !ok {
return fmt.Errorf("There is no crawler[%s]", crawlerName) return fmt.Errorf("There is no crawler[%s]", crawlerName)

View File

@ -63,13 +63,13 @@ func (s *SensorConfigService) AddConfig(sensorConfig *ocsm.SensorConfig) error {
return fmt.Errorf("Sensor config is not valid") return fmt.Errorf("Sensor config is not valid")
} }
sensorConfigID := sensorConfig.ConfigID configID := sensorConfig.ConfigID
if _, ok := s.sensorConfigs[sensorConfigID]; ok { if _, ok := s.sensorConfigs[configID]; ok {
return fmt.Errorf("Sensor config[%s] is exist already", sensorConfigID) 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 return nil
} }
@ -79,14 +79,14 @@ func (s *SensorConfigService) UpdateConfig(sensorConfig *ocsm.SensorConfig) erro
return fmt.Errorf("Sensor config is not valid") return fmt.Errorf("Sensor config is not valid")
} }
sensorConfigID := sensorConfig.ConfigID configID := sensorConfig.ConfigID
if _, ok := s.sensorConfigs[sensorConfigID]; !ok { if _, ok := s.sensorConfigs[configID]; !ok {
return fmt.Errorf("Sensor config[%s] is not exist", sensorConfigID) return fmt.Errorf("Sensor config[%s] is not exist", configID)
} }
delete(s.sensorConfigs, sensorConfigID) delete(s.sensorConfigs, configID)
s.sensorConfigs[sensorConfigID] = sensorConfig s.sensorConfigs[configID] = sensorConfig
logging.Logger().Debugf("Sensor config[%d] was updated", sensorConfigID) logging.Logger().Debugf("Sensor config[%s] was updated", configID)
return nil return nil
} }