-
-
Save xNok/5104a915f7f5bbe81ec2275589e55a48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func write_event_with_params_constror(client influxdb2.Client, t ThermostatSetting) { | |
// Use blocking write client for writes to desired bucket | |
writeAPI := client.WriteAPI(org, bucket) | |
// Create point using full params constructor | |
p := influxdb2.NewPoint("thermostat", | |
map[string]string{"unit": "temperature", "user": t.user}, | |
map[string]interface{}{"avg": t.avg, "max": t.max}, | |
time.Now()) | |
writeAPI.WritePoint(p) | |
// Flush writes | |
writeAPI.Flush() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment