From b46ab3e811ed05cf218787a01067125e6f0fb893 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 2 Nov 2023 11:37:12 +0100 Subject: [PATCH] chore: add field values --- influxdb3/point.go | 6 ++++++ influxdb3/point_values.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/influxdb3/point.go b/influxdb3/point.go index 174d0ee..489c4d8 100644 --- a/influxdb3/point.go +++ b/influxdb3/point.go @@ -151,6 +151,12 @@ func (p *Point) SetIntegerField(name string, value int64) *Point { return p } +// SetUIntegerField adds or replaces an unsigned integer field. +func (p *Point) SetUIntegerField(name string, value uint64) *Point { + p.Values.SetUIntegerField(name, value) + return p +} + // GetStringField gets the string field value associated with the specified name. // If the field is not present, returns nil. func (p *Point) GetStringField(name string) *string { diff --git a/influxdb3/point_values.go b/influxdb3/point_values.go index e35fe5a..c918c84 100644 --- a/influxdb3/point_values.go +++ b/influxdb3/point_values.go @@ -140,6 +140,12 @@ func (pv *PointValues) SetIntegerField(name string, value int64) *PointValues { return pv } +// SetUIntegerField adds or replaces an unsigned integer field. +func (pv *PointValues) SetUIntegerField(name string, value uint64) *PointValues { + pv.Fields[name] = value + return pv +} + // GetStringField gets the string field value associated with the specified name. // If the field is not present, returns nil. func (pv *PointValues) GetStringField(name string) *string {