Documentation ¶
Index ¶
- Constants
- Variables
- func NewSensorId() []byte
- type AirConditionOutdoorMeasurement
- type AirConditionRoomMeasurement
- type AirQualityRoomMeasurement
- type CameraDetectionMeasurement
- type DoorMeasurement
- type HomeConfigMeasurement
- type HomeStateMeasurement
- type IotSimulator
- type IotSimulatorConfig
- type LightLevelRoomMeasurement
- type RadiatorValveRoomMeasurement
- type SmartHome
- func (h *SmartHome) HasMoreMeasurements() bool
- func (h *SmartHome) NewRoom(id int, start time.Time) *room
- func (h *SmartHome) NewSmartHomeMeasurements(start time.Time)
- func (h *SmartHome) NextMeasurement(p *Point) SimulatedMeasurement
- func (h *SmartHome) NumMeasurements() int
- func (h *SmartHome) ResetMeasurementCounter()
- func (h *SmartHome) TickAll(d time.Duration)
- type WaterLeakageRoomMeasurement
- type WaterLevelMeasurement
- type WeatherOutdoorMeasurement
- type WindowMeasurement
Constants ¶
View Source
const SmartHomeIdFormat = "%013d"
Variables ¶
View Source
var ( DoorByteString = []byte("door_state") // heap optimization DoorTagKey = []byte("door_id") )
View Source
var ( RadiatorValveRoomByteString = []byte("radiator_valve_room") // heap optimization RadiatorTagKey = []byte("radiator") )
View Source
var ( // The duration of a log epoch. EpochDuration = 60 * time.Second // Tag fields common to all inside sensors: RoomTagKey = []byte("room_id") // Tag fields common to all inside sensors: SensorHomeTagKeys = [][]byte{ []byte("sensor_id"), []byte("home_id"), } )
View Source
var ( WindowByteString = []byte("window_state_room") // heap optimization WindowTagKey = []byte("window_id") )
View Source
var (
AirConditionOutdoorByteString = []byte("air_condition_outdoor") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. AirConditionOutdoorFieldKeys = [][]byte{ []byte("temperature"), []byte("humidity"), []byte("battery_voltage"), } )
View Source
var (
AirConditionRoomByteString = []byte("air_condition_room") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. AirConditionRoomFieldKeys = [][]byte{ []byte("temperature"), []byte("humidity"), []byte("battery_voltage"), } )
View Source
var (
AirQualityRoomByteString = []byte("air_quality_room") // heap optimization
)
View Source
var ( // Field keys for 'air quality indoor' points. AirQualityRoomFieldKeys = [][]byte{ []byte("co2_level"), []byte("co_level"), []byte("battery_voltage"), } )
View Source
var Animals = [][]byte{ []byte("cat"), []byte("dog"), []byte("bird"), []byte("unknown"), }
View Source
var (
CameraDetectionByteString = []byte("camera_detection") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. CameraDetectionFieldKeys = [][]byte{ []byte("object_type"), []byte("object_kind"), []byte("battery_voltage"), } )
View Source
var DetectionObjects = [][]byte{ []byte("animal"), []byte("human"), []byte("vehicle"), []byte("unknown"), }
View Source
var ( // Field keys for 'air condition indoor' points. DoorFieldKeys = [][]byte{ []byte("state"), []byte("battery_voltage"), } )
View Source
var (
HomeConfigByteString = []byte("home_config") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. HomeConfigFieldKeys = [][]byte{ []byte("config_string"), } )
View Source
var (
HomeStateByteString = []byte("home_state") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. HomeStateFieldKeys = [][]byte{ []byte("state"), []byte("state_string"), } )
View Source
var HomeStates = [][]byte{ []byte("Empty"), []byte("Half"), []byte("Full"), }
View Source
var Humans = [][]byte{ []byte("man"), []byte("woman"), []byte("child"), []byte("unknown"), }
View Source
var LastSensorId = 0
View Source
var (
LightLevelRoomByteString = []byte("light_level_room") // heap optimization
)
View Source
var ( // Field keys for 'air quality indoor' points. LightLevelRoomFieldKeys = [][]byte{ []byte("level"), []byte("battery_voltage"), } )
View Source
var ( // Field keys for 'air quality indoor' points. RadiatorValveRoomFieldKeys = [][]byte{ []byte("opening_level"), []byte("battery_voltage"), } )
View Source
var Vehicles = [][]byte{ []byte("car"), []byte("lorry"), []byte("truck"), []byte("motorcycle"), []byte("bicycle"), []byte("unknown"), }
View Source
var (
WaterLeakageRoomByteString = []byte("water_leakage_room") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. WaterLeakageRoomFieldKeys = [][]byte{ []byte("leakage"), []byte("battery_voltage"), } )
View Source
var (
WaterLevelByteString = []byte("water_level") // heap optimization
)
View Source
var ( // Field keys for 'air quality indoor' points. WaterLevelFieldKeys = [][]byte{ []byte("level"), []byte("battery_voltage"), } )
View Source
var (
WeatherOutdoorByteString = []byte("weather_outdoor") // heap optimization
)
View Source
var ( // Field keys for 'air condition indoor' points. WeatherOutdoorFieldKeys = [][]byte{ []byte("pressure"), []byte("wind_speed"), []byte("wind_direction"), []byte("precipitation"), []byte("battery_voltage"), } )
View Source
var ( // Field keys for 'air condition indoor' points. WindowFieldKeys = [][]byte{ []byte("state"), []byte("battery_voltage"), } )
Functions ¶
func NewSensorId ¶
func NewSensorId() []byte
Types ¶
type AirConditionOutdoorMeasurement ¶
type AirConditionOutdoorMeasurement struct {
// contains filtered or unexported fields
}
func NewAirConditionOutdoorMeasurement ¶
func NewAirConditionOutdoorMeasurement(start time.Time, id []byte) *AirConditionOutdoorMeasurement
func (*AirConditionOutdoorMeasurement) Tick ¶
func (m *AirConditionOutdoorMeasurement) Tick(d time.Duration)
func (*AirConditionOutdoorMeasurement) ToPoint ¶
func (m *AirConditionOutdoorMeasurement) ToPoint(p *Point) bool
type AirConditionRoomMeasurement ¶
type AirConditionRoomMeasurement struct {
// contains filtered or unexported fields
}
func NewAirConditionRoomMeasurement ¶
func NewAirConditionRoomMeasurement(start time.Time, id []byte) *AirConditionRoomMeasurement
func (*AirConditionRoomMeasurement) Tick ¶
func (m *AirConditionRoomMeasurement) Tick(d time.Duration)
func (*AirConditionRoomMeasurement) ToPoint ¶
func (m *AirConditionRoomMeasurement) ToPoint(p *Point) bool
type AirQualityRoomMeasurement ¶
type AirQualityRoomMeasurement struct {
// contains filtered or unexported fields
}
func NewAirQualityRoomMeasurement ¶
func NewAirQualityRoomMeasurement(start time.Time, id []byte) *AirQualityRoomMeasurement
func (*AirQualityRoomMeasurement) Tick ¶
func (m *AirQualityRoomMeasurement) Tick(d time.Duration)
func (*AirQualityRoomMeasurement) ToPoint ¶
func (m *AirQualityRoomMeasurement) ToPoint(p *Point) bool
type CameraDetectionMeasurement ¶
type CameraDetectionMeasurement struct {
// contains filtered or unexported fields
}
func NewCameraDetectionMeasurement ¶
func NewCameraDetectionMeasurement(start time.Time, id []byte) *CameraDetectionMeasurement
func (*CameraDetectionMeasurement) Tick ¶
func (m *CameraDetectionMeasurement) Tick(d time.Duration)
func (*CameraDetectionMeasurement) ToPoint ¶
func (m *CameraDetectionMeasurement) ToPoint(p *Point) bool
type DoorMeasurement ¶
type DoorMeasurement struct {
// contains filtered or unexported fields
}
func NewDoorMeasurement ¶
func NewDoorMeasurement(start time.Time, doorId []byte, sendorId []byte) *DoorMeasurement
func (*DoorMeasurement) Tick ¶
func (m *DoorMeasurement) Tick(d time.Duration)
func (*DoorMeasurement) ToPoint ¶
func (m *DoorMeasurement) ToPoint(p *Point) bool
type HomeConfigMeasurement ¶
type HomeConfigMeasurement struct {
// contains filtered or unexported fields
}
func NewHomeConfigMeasurement ¶
func NewHomeConfigMeasurement(start time.Time, id []byte) *HomeConfigMeasurement
func (*HomeConfigMeasurement) Tick ¶
func (m *HomeConfigMeasurement) Tick(d time.Duration)
func (*HomeConfigMeasurement) ToPoint ¶
func (m *HomeConfigMeasurement) ToPoint(p *Point) bool
type HomeStateMeasurement ¶
type HomeStateMeasurement struct {
// contains filtered or unexported fields
}
func NewHomeStateMeasurement ¶
func NewHomeStateMeasurement(start time.Time, id []byte) *HomeStateMeasurement
func (*HomeStateMeasurement) Tick ¶
func (m *HomeStateMeasurement) Tick(d time.Duration)
func (*HomeStateMeasurement) ToPoint ¶
func (m *HomeStateMeasurement) ToPoint(p *Point) bool
type IotSimulator ¶
type IotSimulator struct {
// contains filtered or unexported fields
}
A IotSimulator generates data similar to telemetry from Telegraf. It fulfills the Simulator interface.
func (*IotSimulator) Finished ¶
func (g *IotSimulator) Finished() bool
func (*IotSimulator) Next ¶
func (g *IotSimulator) Next(p *Point)
Next advances a Point to the next state in the generator.
func (*IotSimulator) SeenPoints ¶
func (g *IotSimulator) SeenPoints() int64
func (*IotSimulator) SeenValues ¶
func (g *IotSimulator) SeenValues() int64
func (*IotSimulator) Total ¶
func (g *IotSimulator) Total() int64
type IotSimulatorConfig ¶
type IotSimulatorConfig struct { Start time.Time End time.Time SmartHomeCount int64 SmartHomeOffset int64 }
Type IotSimulatorConfig is used to create a IotSimulator.
func (*IotSimulatorConfig) ToSimulator ¶
func (d *IotSimulatorConfig) ToSimulator() *IotSimulator
type LightLevelRoomMeasurement ¶
type LightLevelRoomMeasurement struct {
// contains filtered or unexported fields
}
func NewLightLevelRoomMeasurement ¶
func NewLightLevelRoomMeasurement(start time.Time, id []byte) *LightLevelRoomMeasurement
func (*LightLevelRoomMeasurement) Tick ¶
func (m *LightLevelRoomMeasurement) Tick(d time.Duration)
func (*LightLevelRoomMeasurement) ToPoint ¶
func (m *LightLevelRoomMeasurement) ToPoint(p *Point) bool
type RadiatorValveRoomMeasurement ¶
type RadiatorValveRoomMeasurement struct {
// contains filtered or unexported fields
}
func NewRadiatorValveRoomMeasurement ¶
func NewRadiatorValveRoomMeasurement(start time.Time, randiatorId []byte, sensorId []byte) *RadiatorValveRoomMeasurement
func (*RadiatorValveRoomMeasurement) Tick ¶
func (m *RadiatorValveRoomMeasurement) Tick(d time.Duration)
func (*RadiatorValveRoomMeasurement) ToPoint ¶
func (m *RadiatorValveRoomMeasurement) ToPoint(p *Point) bool
type SmartHome ¶
type SmartHome struct { // These are all assigned once, at Host creation: SimulatedMeasurements []SimulatedMeasurement Rooms []*room HomeId []byte // contains filtered or unexported fields }
Type Host models a machine being monitored by Telegraf.
func (*SmartHome) HasMoreMeasurements ¶
func (*SmartHome) NewSmartHomeMeasurements ¶
func (*SmartHome) NextMeasurement ¶
func (h *SmartHome) NextMeasurement(p *Point) SimulatedMeasurement
func (*SmartHome) NumMeasurements ¶
func (*SmartHome) ResetMeasurementCounter ¶
func (h *SmartHome) ResetMeasurementCounter()
type WaterLeakageRoomMeasurement ¶
type WaterLeakageRoomMeasurement struct {
// contains filtered or unexported fields
}
func NewWaterLeakageRoomMeasurement ¶
func NewWaterLeakageRoomMeasurement(start time.Time, roomId []byte, sensorId []byte) *WaterLeakageRoomMeasurement
func (*WaterLeakageRoomMeasurement) Tick ¶
func (m *WaterLeakageRoomMeasurement) Tick(d time.Duration)
func (*WaterLeakageRoomMeasurement) ToPoint ¶
func (m *WaterLeakageRoomMeasurement) ToPoint(p *Point) bool
type WaterLevelMeasurement ¶
type WaterLevelMeasurement struct {
// contains filtered or unexported fields
}
func NewWaterLevelMeasurement ¶
func NewWaterLevelMeasurement(start time.Time, id []byte) *WaterLevelMeasurement
func (*WaterLevelMeasurement) Tick ¶
func (m *WaterLevelMeasurement) Tick(d time.Duration)
func (*WaterLevelMeasurement) ToPoint ¶
func (m *WaterLevelMeasurement) ToPoint(p *Point) bool
type WeatherOutdoorMeasurement ¶
type WeatherOutdoorMeasurement struct {
// contains filtered or unexported fields
}
func NewWeatherOutdoorMeasurement ¶
func NewWeatherOutdoorMeasurement(start time.Time, id []byte) *WeatherOutdoorMeasurement
func (*WeatherOutdoorMeasurement) Tick ¶
func (m *WeatherOutdoorMeasurement) Tick(d time.Duration)
func (*WeatherOutdoorMeasurement) ToPoint ¶
func (m *WeatherOutdoorMeasurement) ToPoint(p *Point) bool
type WindowMeasurement ¶
type WindowMeasurement struct {
// contains filtered or unexported fields
}
func NewWindowMeasurement ¶
func NewWindowMeasurement(start time.Time, windowId []byte, sensorId []byte) *WindowMeasurement
func (*WindowMeasurement) Tick ¶
func (m *WindowMeasurement) Tick(d time.Duration)
func (*WindowMeasurement) ToPoint ¶
func (m *WindowMeasurement) ToPoint(p *Point) bool
Click to show internal directories.
Click to hide internal directories.