Documentation ¶
Index ¶
- Variables
- func DumpBytes(obj interface{}, options ...DumpOption) ([]byte, error)
- func DumpString(obj interface{}, options ...DumpOption) (string, error)
- func MustDumpBytes(obj interface{}, options ...DumpOption) []byte
- func MustDumpString(obj interface{}, options ...DumpOption) string
- func Read(name string, data interface{}) error
- func ToString(o interface{}) string
- func UnQuoteBytes(s []byte) (t []byte, ok bool)
- func Write(name string, data interface{}, perm os.FileMode) error
- type DumpOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCoder = &coder{}
Functions ¶
func DumpBytes ¶ added in v1.2.10
func DumpBytes(obj interface{}, options ...DumpOption) ([]byte, error)
DumpBytes convert Go data object to JSON []byte
func DumpString ¶ added in v1.2.10
func DumpString(obj interface{}, options ...DumpOption) (string, error)
DumpString encode Go data object to JSON string
func MustDumpBytes ¶ added in v1.2.10
func MustDumpBytes(obj interface{}, options ...DumpOption) []byte
MustDumpBytes encode Go data object to JSON []byte (panic in case of error)
func MustDumpString ¶ added in v1.2.10
func MustDumpString(obj interface{}, options ...DumpOption) string
MustDumpString encode Go data object to JSON string (panic in case of error)
func UnQuoteBytes ¶ added in v1.6.13
Types ¶
type DumpOption ¶ added in v1.2.10
func EscapeHTML ¶ added in v1.2.10
func EscapeHTML(escape bool) DumpOption
func Indent ¶ added in v1.2.10
func Indent(prefix, indent string) DumpOption
Indent sets the indentation level (passed as string of spaces) for DumpBytes/DumpString
Click to show internal directories.
Click to hide internal directories.