Documentation
¶
Index ¶
- func NewSensorService(sensorRepo storage.SensorRepository, treeRepo storage.TreeRepository, ...) service.SensorService
- type SensorService
- func (s *SensorService) Create(ctx context.Context, sc *entities.SensorCreate) (*entities.Sensor, error)
- func (s *SensorService) Delete(ctx context.Context, id string) error
- func (s *SensorService) GetAll(ctx context.Context, query entities.Query) ([]*entities.Sensor, int64, error)
- func (s *SensorService) GetAllDataByID(ctx context.Context, id string) ([]*entities.SensorData, error)
- func (s *SensorService) GetByID(ctx context.Context, id string) (*entities.Sensor, error)
- func (s *SensorService) HandleMessage(ctx context.Context, payload *domain.MqttPayload) (*domain.SensorData, error)
- func (s *SensorService) MapSensorToTree(ctx context.Context, sen *entities.Sensor) error
- func (s *SensorService) Ready() bool
- func (s *SensorService) Update(ctx context.Context, id string, su *entities.SensorUpdate) (*entities.Sensor, error)
- func (s *SensorService) UpdateStatuses(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSensorService ¶
func NewSensorService( sensorRepo storage.SensorRepository, treeRepo storage.TreeRepository, eventManager *worker.EventManager, ) service.SensorService
Types ¶
type SensorService ¶
type SensorService struct {
// contains filtered or unexported fields
}
func (*SensorService) Create ¶
func (s *SensorService) Create(ctx context.Context, sc *entities.SensorCreate) (*entities.Sensor, error)
func (*SensorService) GetAllDataByID ¶
func (s *SensorService) GetAllDataByID(ctx context.Context, id string) ([]*entities.SensorData, error)
func (*SensorService) HandleMessage ¶
func (s *SensorService) HandleMessage(ctx context.Context, payload *domain.MqttPayload) (*domain.SensorData, error)
func (*SensorService) MapSensorToTree ¶
func (*SensorService) Ready ¶
func (s *SensorService) Ready() bool
func (*SensorService) Update ¶
func (s *SensorService) Update(ctx context.Context, id string, su *entities.SensorUpdate) (*entities.Sensor, error)
func (*SensorService) UpdateStatuses ¶
func (s *SensorService) UpdateStatuses(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.