|
il y a 2 ans | |
---|---|---|
.. | ||
LICENSE | il y a 2 ans | |
README.md | il y a 2 ans | |
encoder.go | il y a 2 ans | |
escape.go | il y a 2 ans | |
go.mod | il y a 2 ans | |
go.sum | il y a 2 ans | |
handler.go | il y a 2 ans | |
machine.go | il y a 2 ans | |
machine.go.rl | il y a 2 ans | |
metric.go | il y a 2 ans | |
parser.go | il y a 2 ans | |
writer.go | il y a 2 ans |
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