read all sensors implemented
This commit is contained in:
@@ -116,7 +116,14 @@ func (i *inMemory) ReadSensorValues(sensorID string, from time.Time, to time.Tim
|
||||
}
|
||||
|
||||
func (i *inMemory) ReadAllSensors() ([]Sensor, error) {
|
||||
panic("unimplemented")
|
||||
i.mu.Lock()
|
||||
defer i.mu.Unlock()
|
||||
|
||||
sensors := make([]Sensor, 0, len(i.sensors))
|
||||
for _, s := range i.sensors {
|
||||
sensors = append(sensors, *s)
|
||||
}
|
||||
return sensors, nil
|
||||
}
|
||||
|
||||
type DecoratorRepo struct {
|
||||
|
||||
Reference in New Issue
Block a user