Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisplayWriter ¶
type DisplayWriter interface { // Collect accumulated Human Readable output to w. // Ignore must not be returned, nor does it should panic, because this is just intended for human read. // // Interface implementer will not return how much bytes written or error. // // So ensure the Writer is reliable and can consume everything without error, e.g. bytes.Buffer or strings.Builder. WriteDisplay(w StringWriter) }
type Fielder ¶
type Fielder interface {
Fields() Fields
}
Interface to convert any type into types.Fields.
type Fields ¶
func NewFields ¶
Values must be alternating between string and other values, with even index as string. If value is not of type string, it will be coerced to string using fmt.Sprintf.
If len of Values is odd, an extra value of nil will be appended to the end.
If values are empty, an empty map will be returned.
Example:
fields := types.NewFields( "foo", "bar", "baz", 1, "qux", 2, )
func (Fields) MarshalJSON ¶
func (Fields) MarshalJSONObject ¶
func (Fields) WriteDisplay ¶
func (f Fields) WriteDisplay(s StringWriter)
type Logs ¶
type Logs interface {
Logs() Fields
}
An interface similar to Fielder, but this one is intended to also hold more confidential values
The user of this interface must be aware of data breaches. So ensure the data never goes out to wrong party.
type StringWriter ¶
type StringWriter interface { io.Writer io.StringWriter }
A Writer interface that supports both Write and WriteString.
Click to show internal directories.
Click to hide internal directories.