From f330a9f4f5e19acb76f747792ebe8f0e2408b678 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 2 May 2018 20:14:46 +0900 Subject: [PATCH] ing --- service/CollectorService.go | 4 ++-- service/ProbeClientService.go | 16 ++++++++-------- service/service.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/service/CollectorService.go b/service/CollectorService.go index b06874e..96a2534 100644 --- a/service/CollectorService.go +++ b/service/CollectorService.go @@ -28,7 +28,7 @@ type CollectorService struct { ocsp.CollectorService cda.TypeAnnotation `annotation:"@overflow:RPCService()"` - ProbeClientService *ProbeClientService `annotation:"@Inject()"` + ProbeService *ProbeService `annotation:"@Inject()"` CrawlerService *CrawlerService `annotation:"@Inject()"` SensorConfigService *SensorConfigService `annotation:"@Inject()"` @@ -91,7 +91,7 @@ func (s *CollectorService) collectTask(sensorConfig *ocmsc.SensorConfig) { return } - if err := s.ProbeClientService.Send("DataService.Metric", result); nil != err { + if err := s.ProbeService.Send("DataService.Metric", result); nil != err { logging.Logger().Errorf("Cannot send data from config id[%s] of crawler[%s] %v", sensorConfig.ConfigID, sensorConfig.Crawler.Name, err) } } diff --git a/service/ProbeClientService.go b/service/ProbeClientService.go index 45c9cdb..d1708d7 100644 --- a/service/ProbeClientService.go +++ b/service/ProbeClientService.go @@ -11,35 +11,35 @@ import ( _ "git.loafle.net/overflow/commons-go/core/annotation" ) -var ProbeClientServiceType = reflect.TypeOf((*ProbeClientService)(nil)) +var ProbeServiceType = reflect.TypeOf((*ProbeService)(nil)) func init() { - cdr.RegisterType(ProbeClientServiceType) + cdr.RegisterType(ProbeServiceType) } -type ProbeClientService struct { +type ProbeService struct { cda.TypeAnnotation `annotation:"@overflow:RPCService()"` Client *crc.Client `annotation:"@Resource(name='CONTAINER_CLIENT')"` } -func (s *ProbeClientService) InitService() error { +func (s *ProbeService) InitService() error { return nil } -func (s *ProbeClientService) StartService() error { +func (s *ProbeService) StartService() error { return nil } -func (s *ProbeClientService) StopService() { +func (s *ProbeService) StopService() { } -func (s *ProbeClientService) DestroyService() { +func (s *ProbeService) DestroyService() { } -func (s *ProbeClientService) Send(method string, params ...interface{}) error { +func (s *ProbeService) Send(method string, params ...interface{}) error { return s.Client.Send(method, params...) } diff --git a/service/service.go b/service/service.go index 2f8c342..e348a2b 100644 --- a/service/service.go +++ b/service/service.go @@ -4,7 +4,7 @@ import "reflect" var ( OrderedServices = []reflect.Type{ - ProbeClientServiceType, + ProbeServiceType, SensorConfigServiceType, CrawlerServiceType, CollectorServiceType,