Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceManager ¶
type DeviceManager interface { GetRelay(string) (*Relay, error) GetSensor(string, string) (*Sensor, error) CreateSensor(string, string) (*Sensor, error) }
DeviceManager allows for storage & retrieval of devices (sensors & relays)
type DynamoDAO ¶
type DynamoDAO struct {
// contains filtered or unexported fields
}
DynamoDAO represents a database to be used for reading & writing measurements and managing devices
func NewDynamoDAO ¶
func NewDynamoDAO(dynamoDBService dynamodbiface.DynamoDBAPI) *DynamoDAO
NewDynamoDAO builds a new DynamoDAO instance
func (*DynamoDAO) CreateSensor ¶
CreateSensor creates a new sensor by ID within an account
type InfluxDAO ¶
type InfluxDAO struct {
// contains filtered or unexported fields
}
InfluxDAO represents a DAO capable of interacting with InfluxDB
func NewInfluxDAO ¶
func NewInfluxDAO(address string, username string, password string, databaseName string, deviceManager DeviceManager) (*InfluxDAO, error)
NewInfluxDAO creates a new DAO for interacting with InfluxDB
func (*InfluxDAO) WriteSensorReading ¶
func (i *InfluxDAO) WriteSensorReading(r *msg.SensorReadingQueueMessage) error
WriteSensorReading will record the Sensor Reading data, first verifying that a corresponding reporting device and account exist and are active
type MeasurementWriter ¶
type MeasurementWriter interface {
WriteSensorReading(*msg.SensorReadingQueueMessage) error
}
MeasurementWriter is capable of writing sensor readings to storage
type Relay ¶
type Relay struct { ID string `json:"id"` AccountID string `json:"account_id"` Name string `json:"name"` State string `json:"state"` }
Relay represents a StreamMarker relay
type Sensor ¶
type Sensor struct { ID string `json:"id"` AccountID string `json:"account_id"` Name string `json:"name"` State string `json:"state"` SampleFrequency int64 `json:"sample_frequency"` LocationEnabled bool `json:"location_enabled"` Latitude float64 `json:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty"` }
Sensor represents a Sensor capable of taking measurements