Move Handler interface into machine where it is used

This commit is contained in:
Daniel Nelson 2018-03-29 16:40:03 -07:00
parent 0c1293ad5e
commit 38ec968b0b
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
3 changed files with 262 additions and 252 deletions

File diff suppressed because it is too large Load Diff

View File

@ -225,6 +225,17 @@ align :=
%% write data; %% write data;
type Handler interface {
SetMeasurement(name []byte)
AddTag(key []byte, value []byte)
AddInt(key []byte, value []byte)
AddUint(key []byte, value []byte)
AddFloat(key []byte, value []byte)
AddString(key []byte, value []byte)
AddBool(key []byte, value []byte)
SetTimestamp(tm []byte)
}
type machine struct { type machine struct {
data []byte data []byte
cs int cs int

View File

@ -15,18 +15,6 @@ var (
ErrNoMetric = errors.New("no metric in line") ErrNoMetric = errors.New("no metric in line")
) )
type Handler interface {
SetMeasurement(name []byte)
AddTag(key []byte, value []byte)
AddInt(key []byte, value []byte)
AddUint(key []byte, value []byte)
AddFloat(key []byte, value []byte)
AddString(key []byte, value []byte)
AddBool(key []byte, value []byte)
SetTimestamp(tm []byte)
Reset()
}
type ParseError struct { type ParseError struct {
Offset int Offset int
msg string msg string