Documentation ¶
Index ¶
- func GetExtraLabels(req *http.Request) ([]prompbmarshal.Label, error)
- func GetGzipReader(r io.Reader) (*gzip.Reader, error)
- func PutGzipReader(zr *gzip.Reader)
- func ReadLinesBlock(r io.Reader, dstBuf, tailBuf []byte) ([]byte, []byte, error)
- func ReadLinesBlockExt(r io.Reader, dstBuf, tailBuf []byte, maxLineLen int) ([]byte, []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExtraLabels ¶ added in v1.40.1
func GetExtraLabels(req *http.Request) ([]prompbmarshal.Label, error)
GetExtraLabels extracts name:value labels from `extra_label=name=value` query args from req.
func GetGzipReader ¶
GetGzipReader returns new gzip reader from the pool.
Return back the gzip reader when it no longer needed with PutGzipReader.
func PutGzipReader ¶
PutGzipReader returns back gzip reader obtained via GetGzipReader.
func ReadLinesBlock ¶
ReadLinesBlock reads a block of lines delimited by '\n' from tailBuf and r into dstBuf.
Trailing chars after the last newline are put into tailBuf.
Returns (dstBuf, tailBuf).
It is expected that read timeout on r exceeds 1 second.
func ReadLinesBlockExt ¶
ReadLinesBlockExt reads a block of lines delimited by '\n' from tailBuf and r into dstBuf.
Trailing chars after the last newline are put into tailBuf.
Returns (dstBuf, tailBuf).
maxLineLen limits the maximum length of a single line.
It is expected that read timeout on r exceeds 1 second.
Types ¶
This section is empty.