|
2 years ago | |
---|---|---|
.. | ||
LICENSE | 2 years ago | |
README.md | 2 years ago | |
encoder.go | 2 years ago | |
escape.go | 2 years ago | |
go.mod | 2 years ago | |
go.sum | 2 years ago | |
handler.go | 2 years ago | |
machine.go | 2 years ago | |
machine.go.rl | 2 years ago | |
metric.go | 2 years ago | |
parser.go | 2 years ago | |
writer.go | 2 years ago |
This is an encoder for the influx line protocol.
It has an interface similar to the standard library's json.Encoder
.
Encoder.Encode
concurrently you have to manage the concurrency yourself.buf := &bytes.Buffer{}
serializer := protocol.NewEncoder(buf)
serializer.SetMaxLineBytes(1024)
serializer.SetFieldTypeSupport(UintSupport)
serializer.Encode(e) // where e is something that implements the protocol.Metric interface