Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter func(interface{}) string
Formatter transforms the input into a formatted string.
type KeyValueWriter ¶
type KeyValueWriter struct { // Out is the output destination. Out io.Writer // PairsDelimiter defines a character to delimit individual pairs. (default: ' ') PairsDelimiter rune // KeyValueDelimiter defines a character to delimit key and value. (default: '=') KeyValueDelimiter rune // QuoteValues defines if you want to quote values. If enabled it will quote all values // for consistency. If PairsDelimiter doesn't occur in the keys nor values // then you don't need to quote values. (default: true) QuoteValues bool // KeysExclude defines keys to not display in output. JSON structure is flattened so // json '{"event": {"name": "x"}}' would produce 'event.name' key with 'x' as a value. KeysExclude []string FormatKey Formatter FormatValue Formatter FormatExtra func(map[string]interface{}, *bytes.Buffer) error }
KeyValueWriter parses the JSON input and writes it in a human-friendly format to Out.
func NewKeyValueWriter ¶
func NewKeyValueWriter(options ...func(w *KeyValueWriter)) KeyValueWriter
NewKeyValueWriter creates and initializes a new KeyValueWriter.
Click to show internal directories.
Click to hide internal directories.