Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringFromValue ¶
func StringFromValue(v interface{}) string
StringFromValue creates a string from the value by calling the value's MarshalJSON or MarshalText methods if present, and otherwise calling fmt.Sprint.
Types ¶
type IndexedMapValue ¶
type IndexedMapValue struct { Value interface{} Index uint64 }
func (*IndexedMapValue) UnmarshalJSON ¶
func (mi *IndexedMapValue) UnmarshalJSON(b []byte) error
UnmarshalJSON for an indexed map item. Used for sorting the resulting MapSlice.
type MapSlice ¶
type MapSlice []MapItem
func FromKeyvals ¶
func FromKeyvals(keyvals ...interface{}) MapSlice
FromKeyvals creates an ordered map containing the keys and values of the log message. The keys are formatted to strings, as well as any values that do not implement json.Marshaler or encoding.TextMarshaler.
A final value "missing" is inserted if an odd number of values are passed to FromKeyvals.
func (MapSlice) JSONString ¶
JSONString creates an ordered JSON representation of the keys and values in the MapSlice.
func (MapSlice) MarshalJSON ¶
func (MapSlice) ToStringMap ¶
func (*MapSlice) UnmarshalJSON ¶
UnmarshalJSON adds entries from the JSON object to the MapSlice.