package service import ( "reflect" cda "git.loafle.net/commons/di-go/annotation" cdr "git.loafle.net/commons/di-go/registry" logging "git.loafle.net/commons/logging-go" // For annotation _ "git.loafle.net/overflow/commons-go/core/annotation" ) var DataServiceType = reflect.TypeOf((*DataService)(nil)) func init() { cdr.RegisterType(DataServiceType) } type DataService struct { cda.TypeAnnotation `annotation:"@overflow:RPCService()"` DataClientService *DataClientService `annotation:"@Inject()"` } func (s *DataService) InitService() error { return nil } func (s *DataService) StartService() error { return nil } func (s *DataService) StopService() { } func (s *DataService) DestroyService() { } func (s *DataService) Metric(sensorConfigID string, metric map[string]string) error { // s.DataClientService.Send("MS", sensorConfigID, metric) logging.Logger().Debugf("Metric: %v", metric) return nil }