Documentation ¶
Overview ¶
Adapted from https://github.com/go-logfmt/logfmt/ but []byte as parameter instead Original license is MIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads and decodes logfmt records from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
The decoder introduces its own buffering and may read data from r beyond the logfmt records requested.
func (*Decoder) Key ¶
Key returns the most recent key found by a call to ScanKeyval. The returned slice may point to internal buffers and is only valid until the next call to ScanRecord. It does no allocation.
func (*Decoder) ScanKeyval ¶
ScanKeyval advances the Decoder to the next key/value pair of the current record, which can then be retrieved with the Key and Value methods. It returns false when decoding stops, either by reaching the end of the current record or an error.
type SyntaxError ¶
A SyntaxError represents a syntax error in the logfmt input stream.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string