Documentation ¶
Index ¶
- Constants
- func NewPoint(name, host string, measurement senml.Measurement) (*influxdb.Point, error)
- func NewSenML(row *models.Row) (m []senml.Measurement, err error)
- func PointsFromSenML(name, host string, list []senml.Measurement) (pts []*influxdb.Point, err error)
- type Client
- func (c *Client) Query(q client.Query) (res []client.Result, err error)
- func (c *Client) SenMLQuery(name, host string, from, to time.Time, last bool) (measurements []senml.Measurement, err error)
- func (c *Client) WritePoints(rp string, points ...*client.Point) error
- func (c *Client) WriteSenML(name, host, rp string, data ...senml.Measurement) error
- type ClientConfig
Constants ¶
View Source
const ( BooleanField = "bool" DataField = "data" StringField = "string" SumField = "sum" ValueField = "value" UpdateTimeField = "update_time" HostTag = "host" NameTag = "name" UnitTag = "unit" TimeField = "time" )
InfluxDB tag and field values.
Variables ¶
This section is empty.
Functions ¶
func NewPoint ¶
NewPoint returns an InfluxDB point for a SenML measurement.
Types ¶
type Client ¶
type Client struct { client.Client Database string // contains filtered or unexported fields }
Client is an extended InfluxDB client
func NewClient ¶
func NewClient(config *ClientConfig) (c *Client, err error)
NewClient returns a Client for the given configuration
func (*Client) Query ¶
Query executes a query and returns the result
func (*Client) SenMLQuery ¶
func (c *Client) SenMLQuery(name, host string, from, to time.Time, last bool) (measurements []senml.Measurement, err error)
SenMLQuery builds a query based on the given parameters and returns the result as SenML.
func (*Client) WritePoints ¶
WritePoints writes a series of points to InfluxDB.
Click to show internal directories.
Click to hide internal directories.