Discover Packages
github.com/icholy/jsonlogfmt
package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Apr 22, 2020
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
jsonlogfmt
This package provides an io.Reader implementation that converts from logfmt data to json
Expand ▾
Collapse ▴
Documentation
¶
InferFields takes a struct type, and converts it into a set of
fields to be used in a schema. This function will panic
if t is not a struct type or a pointer to a struct
ParseValue parses a string as the provided type
Reader converts logfmt data to json
NewReader returns a Reader that converts from logfmt to json.
Read implements io.Reader
ReadMap reads the next logfmt record, converts the fields
according to the schema and returns them in a map
SetIndent calls SetIndent on the json.Encoder
Schema describes a set of fields and their types
Set implements flag.Value and allows expects fields
with the following syntax name:type (see ParseType for valid types)
String returns a string representation of the schema.
Valid returns true if the key should be included in the output
Type is the type of a field
const (
NumberType Type = iota
DurationType
StringType
TimeType
BoolType
)
ParseType parses the string representation of a type.
Currently: number, duration, string, bool
String returns the string representation of a type
Source Files
¶
Directories
¶
cmd
Click to show internal directories.
Click to hide internal directories.