Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSensorStore ¶
NewSensorStore creates a new sensor store
Types ¶
type Sensor ¶
type Sensor struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Name string `bson:"name"`
Tags []string `bson:"tags"`
Location *Location `bson:"location"`
GeoJson *GeoJson `bson:"geoJson"`
}
Sensor represents a sensor with meta-data
type SensorStore ¶
type SensorStore interface {
Add(ctx context.Context, sensor Sensor) (primitive.ObjectID, error)
Update(ctx context.Context, sensor Sensor) error
Delete(ctx context.Context, id primitive.ObjectID) error
FindByID(ctx context.Context, id primitive.ObjectID) (*Sensor, error)
FindByName(ctx context.Context, name string) (*Sensor, error)
FindNearest(ctx context.Context, location Location) (*Sensor, error)
}
SensorStore represents the public interface of the sensorStore
Click to show internal directories.
Click to hide internal directories.