weather-api/storage/sensor-registry.go
2021-04-25 00:31:27 +02:00

23 lines
588 B
Go

package storage
import "github.com/google/uuid"
type SensorRegistry interface {
RegisterSensorByName(string) (*WeatherSensor, error)
ExistSensor(sensorId uuid.UUID) (bool, error)
ExistSensorName(name string) (bool, error)
ResolveSensorById(uuid.UUID) (*WeatherSensor, error)
DeleteSensor(uuid.UUID) error
UpdateSensor(*WeatherSensor) error
GetSensors() ([]*WeatherSensor, error)
Close() error
}
//WeatherSensor is the data for a new Sensorregistration
type WeatherSensor struct {
Name string
Id uuid.UUID
Location string
Longitude float64
Latitude float64
}