fix(pkg/sensor): reduce interface functions for better error handling
This commit is contained in:
@ -1,15 +1,12 @@
|
||||
package sensor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/go-flucky/flucky/pkg/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Sensor interface {
|
||||
GetSensorModel() types.SensorModel
|
||||
ID() string
|
||||
Read() ([]*types.MeasuredValue, error)
|
||||
ReadChannel(measuredValueChannel chan<- *types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
|
||||
ReadContinously(ctx context.Context, measuredValueChannel chan<- *types.MeasuredValue, errorChannel chan<- error)
|
||||
Ticker() *time.Ticker
|
||||
}
|
||||
|
Reference in New Issue
Block a user