data

package
v0.0.0-...-d4c5c8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadedPoint

type LoadedPoint struct {
	Data interface{}
}

Point acts as a 'holder' for the internal representation of a point in a given load client. Instead of using interface{} as a return type, we get compile safety by using Point

func NewLoadedPoint

func NewLoadedPoint(data interface{}) LoadedPoint

NewPoint creates a Point with the provided data as the internal representation

type Point

type Point struct {
	// contains filtered or unexported fields
}

Point wraps a single data point. It stores database-agnostic data representing one point in time of one measurement.

Internally, Point uses byte slices instead of strings to try to minimize overhead.

func NewPoint

func NewPoint() *Point

NewPoint returns a new empty Point

func (*Point) AppendField

func (p *Point) AppendField(key []byte, value interface{})

AppendField adds a field with a given key and value to this data point

func (*Point) AppendTag

func (p *Point) AppendTag(key []byte, value interface{})

AppendTag adds a tag with a given key and value to this data point

func (*Point) ClearFieldValue

func (p *Point) ClearFieldValue(key []byte)

ClearFieldValue sets the field value to nil for a given field key. This will panic if the internal state has been altered to not have the same number of field keys as field values.

func (*Point) ClearTagValue

func (p *Point) ClearTagValue(key []byte)

ClearTagValue sets the tag value to nil for a given field key. This will panic if the internal state has been altered to not have the same number of tag keys as tag values.

func (*Point) Copy

func (p *Point) Copy(from *Point)

Copy duplicates all the values from a given Point.

func (*Point) FieldKeys

func (p *Point) FieldKeys() [][]byte

FieldKeys returns the Point's field keys

func (*Point) FieldValues

func (p *Point) FieldValues() []interface{}

func (*Point) GetFieldValue

func (p *Point) GetFieldValue(key []byte) interface{}

GetFieldValue returns the corresponding value for a given field key or nil if it does not exist. This will panic if the internal state has been altered to not have the same number of field keys as field values.

func (*Point) GetTagValue

func (p *Point) GetTagValue(key []byte) interface{}

GetTagValue returns the corresponding value for a given tag key or nil if it does not exist. This will panic if the internal state has been altered to not have the same number of tag keys as tag values.

func (*Point) MeasurementName

func (p *Point) MeasurementName() []byte

MeasurementName returns the name of the Point's measurement

func (*Point) Reset

func (p *Point) Reset()

Reset clears all information from this Point so it can be reused.

func (*Point) SetMeasurementName

func (p *Point) SetMeasurementName(s []byte)

SetMeasurementName sets the name of the measurement for this data point

func (*Point) SetTimestamp

func (p *Point) SetTimestamp(t *time.Time)

SetTimestamp sets the Timestamp for this data point

func (*Point) TagKeys

func (p *Point) TagKeys() [][]byte

TagKeys returns the Point's tag keys

func (*Point) TagValues

func (p *Point) TagValues() []interface{}

func (*Point) Timestamp

func (p *Point) Timestamp() *time.Time

func (*Point) TimestampInUnixMs

func (p *Point) TimestampInUnixMs() int64

Directories

Path Synopsis
iot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL