Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoMetric = errors.New("no metric in line") ErrEOF = errors.New("EOF") )
Functions ¶
This section is empty.
Types ¶
type ParseError ¶
type ParseError struct { *lineprotocol.DecodeError // contains filtered or unexported fields }
ParseError indicates a error in the parsing of the text.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Parser ¶
Parser is an InfluxDB Line Protocol parser that implements the parsers.Parser interface.
func NewSeriesParser ¶
func NewSeriesParser() *Parser
NewSeriesParser returns a Parser than accepts a measurement and tagset
func (*Parser) SetDefaultTags ¶
func (*Parser) SetTimeFunc ¶
func (*Parser) SetTimePrecision ¶
type StreamParser ¶
type StreamParser struct {
// contains filtered or unexported fields
}
StreamParser is an InfluxDB Line Protocol parser. It is not safe for concurrent use in multiple goroutines.
func NewStreamParser ¶
func NewStreamParser(r io.Reader) *StreamParser
func (*StreamParser) Next ¶
func (sp *StreamParser) Next() (telegraf.Metric, error)
Next parses the next item from the stream. You can repeat calls to this function if it returns ParseError to get the next metric or error.
func (*StreamParser) SetTimeFunc ¶
func (sp *StreamParser) SetTimeFunc(f TimeFunc)
SetTimeFunc changes the function used to determine the time of metrics without a timestamp. The default TimeFunc is time.Now. Useful mostly for testing, or perhaps if you want all metrics to have the same timestamp.
func (*StreamParser) SetTimePrecision ¶
func (sp *StreamParser) SetTimePrecision(u time.Duration)