commit
857afc1006
|
@ -73,7 +73,7 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
|
||||
// Create a new point batch
|
||||
bp, err := client.NewBatchPoints(client.BatchPointsConfig{
|
||||
Database: MyDB,
|
||||
|
@ -101,7 +101,7 @@ func main() {
|
|||
if err := c.Write(bp); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
// Close client resources
|
||||
if err := c.Close(); err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -250,11 +250,12 @@ The **InfluxDB** client also supports writing over UDP.
|
|||
```go
|
||||
func WriteUDP() {
|
||||
// Make client
|
||||
c, err := client.NewUDPClient("localhost:8089")
|
||||
// PayloadSize is default value(512)
|
||||
c, err := client.NewUDPClient(client.UDPConfig{Addr: "localhost:8089"})
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
|
||||
// Create a new point batch
|
||||
bp, _ := client.NewBatchPoints(client.BatchPointsConfig{
|
||||
Precision: "s",
|
||||
|
|
Loading…
Reference in New Issue