Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendQuoteString ¶ added in v1.6.1
func AppendQuoteString(buf *byteutil.Buffer, str string)
AppendQuoteString will append (and escape/quote where necessary) a field string.
func AppendQuoteValue ¶ added in v1.5.0
func AppendQuoteValue(buf *byteutil.Buffer, str string)
AppendQuoteValue will append (and escape/quote where necessary) a formatted value string.
Types ¶
type Field ¶
type Field struct { K string // Field key V interface{} // Field value }
Field represents an individual key-value field.
func (Field) AppendFormat ¶
AppendFormat will append formatted format of Field to 'buf'. See .String() for details.
func (Field) String ¶
String will return a string representation of this Field of the form `key=value` where `value` is formatted using fmt package's `%+v` directive. If the .X = true (verbose), then it uses '%#v'. Both key and value are escaped and quoted if necessary to fit on single line.
If the `kvformat` build tag is provided, the formatting will be performed by the `kv/format` package. In this case the value will be formatted using the `{:v}` directive, or `{:?}` if .X = true (verbose).
type Fields ¶
type Fields []Field
Fields is a typedef for a []Field slice to provide slightly more performant string formatting for multiples.
func (Fields) AppendFormat ¶
AppendFormat appends a string representation of receiving Field(s) to 'b'.