Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct { // UseNumber causes the Decoder to unmarshal a number into an any as a // Number instead of as a float64. UseNumber bool // DisallowUnknownFields causes the Decoder to return an error when the destination // is a struct and the input contains object keys which do not match any // non-ignored, exported fields in the destination. DisallowUnknownFields bool }
Codec is a Marshaler which marshals/unmarshals into/from JSON with the standard "encoding/json" package of Golang. Although it is generally faster for simple proto messages than JSONPb, it does not support advanced features of protobuf, e.g. map, oneof, ....
The NewEncoder and NewDecoder types return *json.Encoder and *json.Decoder respectively.
func (*Codec) ContentType ¶
ContentType always Returns "application/json; charset=utf-8".
Click to show internal directories.
Click to hide internal directories.