Documentation ¶
Index ¶
- Constants
- Variables
- func DumpStructWithPrivateFields(s State, v reflect.Value)
- func Fdump(out io.Writer, values ...interface{})
- func FdumpColor(out io.Writer, values ...interface{})
- func RegisterCustomDumper(v interface{}, f DumpFunc)
- func Sdump(values ...interface{}) string
- func UnregisterCustomDumper(v interface{})
- type DumpFunc
- type Dumpable
- type State
Constants ¶
View Source
const ElementsPerLine = 30
Variables ¶
View Source
var Dump = defaultDump
Dump points to the default dumper
Functions ¶
func FdumpColor ¶
FdumpColor prints to the writer the value with indentation and color.
func RegisterCustomDumper ¶
func RegisterCustomDumper(v interface{}, f DumpFunc)
func Sdump ¶
func Sdump(values ...interface{}) string
Sdump dumps the values into a string with indentation.
func UnregisterCustomDumper ¶
func UnregisterCustomDumper(v interface{})
Types ¶
type Dumpable ¶
type Dumpable interface {
Dump(State)
}
Dumpable is the interface for implementing custom dumper for your types.
type State ¶
type State interface { io.Writer WithTempBuffer(func(buf *bytes.Buffer)) string AddComment(string) ResetComments() []string ForceNewLines(bool) bool DepthUp() DepthDown() Pad() Dump(value interface{}) DumpString(str string) DumpScalar(v interface{}, t reflect.Type, dumpTypeInstantiation bool) DumpComplex(v complex128, t reflect.Kind) DumpStructType(t reflect.Type) DumpStructField(string, reflect.Value) }
Click to show internal directories.
Click to hide internal directories.