Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoGoJSONPb ¶
GoGoJSONPb is a Marshaler which marshals/unmarshals into/from JSON with the "github.com/gogo/protobuf/jsonpb". It supports fully functionality of protobuf unlike JSONBuiltin.
func (*GoGoJSONPb) ContentType ¶
func (*GoGoJSONPb) ContentType() string
ContentType always returns "application/json".
func (*GoGoJSONPb) Marshal ¶
func (j *GoGoJSONPb) Marshal(v interface{}) ([]byte, error)
Marshal marshals "v" into JSON Currently it can marshal only proto.Message. TODO(yugui) Support fields of primitive types in a message.
func (*GoGoJSONPb) NewDecoder ¶
func (j *GoGoJSONPb) NewDecoder(r io.Reader) Decoder
NewDecoder returns a Decoder which reads JSON stream from "r".
func (*GoGoJSONPb) NewEncoder ¶
func (j *GoGoJSONPb) NewEncoder(w io.Writer) Encoder
NewEncoder returns an Encoder which writes JSON stream into "w".
func (*GoGoJSONPb) Unmarshal ¶
func (j *GoGoJSONPb) Unmarshal(data []byte, v interface{}) error
Unmarshal unmarshals JSON "data" into "v" Currently it can marshal only proto.Message. TODO(yugui) Support fields of primitive types in a message.