Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { // Presents data type. Use constants: util.CarbonMonoxide, util.AirQuality, util.Raindrops, util.SoilMoisture. DataType string `json:"dataType"` // Sensor value. Value float32 `json:"value"` // When was the Value taken. Timestamp time.Time `json:"timestamp"` }
Data is a struct used for serializing data to the database.
func (*Data) ConvertToDC ¶
func (d *Data) ConvertToDC() *pb.DataWithCategory
ConvertToDC converts Data to pb.DataWithCategory.
func (Data) MarshalBinary ¶
type DataResponse ¶
type DataResponse struct { // Embedded Data struct. Data // Data.Value category. Check functions util.GetCategory. Category int `json:"category"` }
DataResponse is a struct for serializing data from the database.
func (*DataResponse) Convert ¶
func (dr *DataResponse) Convert() *pb.DataWithCategory
Convert DataResponse to pb.DataWithCategory.
func (*DataResponse) Equals ¶
func (dr *DataResponse) Equals(b *DataResponse) bool
Equals compares two DataResponse structures.
func (DataResponse) MarshalBinary ¶
func (dr DataResponse) MarshalBinary() ([]byte, error)
func (*DataResponse) String ¶
func (dr *DataResponse) String() string
String returns DataResponse fields in a string.
Click to show internal directories.
Click to hide internal directories.