Documentation ¶
Index ¶
- Constants
- Variables
- func NewMachine(handler Handler) *machine
- func NewSeriesMachine(handler Handler) *machine
- type Handler
- type MetricHandler
- func (h *MetricHandler) AddBool(key []byte, value []byte)
- func (h *MetricHandler) AddFloat(key []byte, value []byte)
- func (h *MetricHandler) AddInt(key []byte, value []byte)
- func (h *MetricHandler) AddString(key []byte, value []byte)
- func (h *MetricHandler) AddTag(key []byte, value []byte)
- func (h *MetricHandler) AddUint(key []byte, value []byte)
- func (h *MetricHandler) Metric() (telegraf.Metric, error)
- func (h *MetricHandler) Reset()
- func (h *MetricHandler) SetMeasurement(name []byte)
- func (h *MetricHandler) SetTimeFunc(f metric.TimeFunc)
- func (h *MetricHandler) SetTimePrecision(precision time.Duration)
- func (h *MetricHandler) SetTimestamp(tm []byte)
- type ParseError
- type Parser
Constants ¶
View Source
const LineProtocol_en_align int = 196
View Source
const LineProtocol_en_discard_line int = 195
View Source
const LineProtocol_en_main int = 1
View Source
const LineProtocol_en_series int = 199
View Source
const LineProtocol_error int = 0
View Source
const LineProtocol_first_final int = 206
View Source
const LineProtocol_start int = 1
Variables ¶
View Source
var ( ErrNameParse = errors.New("expected measurement name") ErrFieldParse = errors.New("expected field") ErrTagParse = errors.New("expected tag") ErrTimestampParse = errors.New("expected timestamp") ErrParse = errors.New("parse error") )
View Source
var (
ErrNoMetric = errors.New("no metric in line")
)
Functions ¶
func NewMachine ¶
func NewMachine(handler Handler) *machine
func NewSeriesMachine ¶
func NewSeriesMachine(handler Handler) *machine
Types ¶
type MetricHandler ¶
type MetricHandler struct {
// contains filtered or unexported fields
}
func NewMetricHandler ¶
func NewMetricHandler() *MetricHandler
func (*MetricHandler) AddBool ¶
func (h *MetricHandler) AddBool(key []byte, value []byte)
func (*MetricHandler) AddFloat ¶
func (h *MetricHandler) AddFloat(key []byte, value []byte)
func (*MetricHandler) AddInt ¶
func (h *MetricHandler) AddInt(key []byte, value []byte)
func (*MetricHandler) AddString ¶
func (h *MetricHandler) AddString(key []byte, value []byte)
func (*MetricHandler) AddTag ¶
func (h *MetricHandler) AddTag(key []byte, value []byte)
func (*MetricHandler) AddUint ¶
func (h *MetricHandler) AddUint(key []byte, value []byte)
func (*MetricHandler) Reset ¶
func (h *MetricHandler) Reset()
func (*MetricHandler) SetMeasurement ¶
func (h *MetricHandler) SetMeasurement(name []byte)
func (*MetricHandler) SetTimeFunc ¶
func (h *MetricHandler) SetTimeFunc(f metric.TimeFunc)
func (*MetricHandler) SetTimePrecision ¶
func (h *MetricHandler) SetTimePrecision(precision time.Duration)
func (*MetricHandler) SetTimestamp ¶
func (h *MetricHandler) SetTimestamp(tm []byte)
type ParseError ¶
type ParseError struct { Offset int // contains filtered or unexported fields }
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Parser ¶
type Parser struct { DefaultTags map[string]string sync.Mutex // contains filtered or unexported fields }
func NewParser ¶
func NewParser(handler *MetricHandler) *Parser
NewParser returns a Parser than accepts line protocol
func NewSeriesParser ¶
func NewSeriesParser(handler *MetricHandler) *Parser
NewSeriesParser returns a Parser than accepts a measurement and tagset
func (Parser) Err ¶
func (m Parser) Err() error
Err returns the error that occurred on the last call to ParseLine. If the result is nil, then the line was parsed successfully.
func (Parser) Position ¶
func (m Parser) Position() int
Position returns the current position into the input.
func (*Parser) SetDefaultTags ¶
Click to show internal directories.
Click to hide internal directories.