weather-api/storage/sensor-registry.go
2021-04-24 23:38:58 +02:00

22 lines
540 B
Go

package storage
import "github.com/google/uuid"
type SensorRegistry interface {
RegisterSensorByName(string) (*WeatherSensor, error)
ExistSensor(*WeatherSensor) (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
}