InfluxElixir.Client.Local.Body (InfluxElixir v0.1.37)

Copy Markdown View Source

Reads a write request's body as the engine does before it parses a line (verified against InfluxDB 3 Core and InfluxDB 2.7).

  • gzip: true (Content-Encoding: gzip) decompresses the body. It is the header that decides, not the bytes: a gzip body sent without it is parsed as line protocol, and a plain body sent with it fails. Concatenated gzip members are read as one body. InfluxDB 3 answers a body it cannot decompress with a 400 error decoding gzip stream: <reason>: unexpected end of file (a body shorter than a gzip header, or cut short), invalid gzip header, corrupt deflate stream, or corrupt gzip stream does not have a matching checksum; InfluxDB 2 with its 500 internal error. Bytes after a complete gzip stream are not modelled exactly.
  • InfluxDB 3 then refuses a body that is not UTF-8 with a 400 body content is not valid utf8: ..., naming the first bad byte as Rust's Utf8Error does. InfluxDB 2 stores the bytes as they are.

Summary

Functions

The body the engine parses, or its error for the profile.

Functions

read(body, gzip?, profile)

@spec read(binary(), boolean(), atom()) :: {:ok, binary()} | {:error, map()}

The body the engine parses, or its error for the profile.