Documentation ¶
Overview ¶
Package codec is a unified place for configuring and allocating JSON encoders and decoders.
Example ¶
enc := GetEncoder(os.Stdout) defer PutEncoder(enc) enc.MustEncode([]string{"a", "slice", "of", "strings"}) fmt.Fprintln(os.Stdout) enc.MustEncode(nil) fmt.Fprintln(os.Stdout) enc.MustEncode(map[string]string{}) fmt.Fprintln(os.Stdout)
Output: ["a","slice","of","strings"] null {}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONReader ¶
func JSONReader(v interface{}) io.ReadCloser
JSONReader returns an io.ReadCloser backed by a pipe being fed by a JSON encoder.
Types ¶
type Decoder ¶
Decoder decodes.
func GetDecoder ¶
GetDecoder returns a decoder configured to read from r.
Click to show internal directories.
Click to hide internal directories.