Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Influx ¶
type Influx struct {
// contains filtered or unexported fields
}
Influx represents and influxdb that we can write samples to
func (*Influx) WriteSamples ¶
func (i *Influx) WriteSamples(samples []InfluxPoint) error
WriteSamples to influxdb
type InfluxPoint ¶ added in v0.0.12
type InfluxPoint struct {
// Type of point (voltage, current, key, etc)
Type string `influx:"type,tag"`
// ID of the sensor that provided the sample
ID string `influx:"id,tag"`
// DeviceID of the ID of the device that provided the sample
DeviceID string `influx:"deviceId,tag"`
// Average OR
// Instantaneous analog or digital value of the sample.
// 0 and 1 are used to represent digital values
Value float64 `influx:"value"`
// statistical values that may be calculated
Min float64 `influx:"min"`
Max float64 `influx:"max"`
// Time the sample was taken
Time time.Time `influx:"time"`
// Duration over which the sample was taken
Duration time.Duration `influx:"duration"`
}
InfluxPoint represents a sample that is written into influxdb
func PointToInfluxPoint ¶ added in v0.0.12
func PointToInfluxPoint(deviceID string, p data.Point) InfluxPoint
PointToInfluxPoint converts a sample to influx sample
Click to show internal directories.
Click to hide internal directories.