type JSONPb … // ContentType always returns "application/json". func (*JSONPb) ContentType() string { … } // Marshal marshals "v" into JSON. func (j *JSONPb) Marshal(v interface{ … } func (j *JSONPb) marshalTo(w io.Writer, v interface{ … } var protoMessageType … // marshalNonProto marshals a non-message field of a protobuf message. // This function does not correctly marshals arbitrary data structure into JSON, // but it is only capable of marshaling non-message field values of protobuf, // i.e. primitive types, enums; pointers to primitives or enums; maps from // integer/string types to primitives/enums/pointers to messages. func (j *JSONPb) marshalNonProtoField(v interface{ … } // Unmarshal unmarshals JSON "data" into "v" func (j *JSONPb) Unmarshal(data []byte, v interface{ … } // NewDecoder returns a Decoder which reads JSON stream from "r". func (j *JSONPb) NewDecoder(r io.Reader) Decoder { … } type DecoderWrapper … // Decode wraps the embedded decoder's Decode method to support // protos using a jsonpb.Unmarshaler. func (d DecoderWrapper) Decode(v interface{ … } // NewEncoder returns an Encoder which writes JSON stream into "w". func (j *JSONPb) NewEncoder(w io.Writer) Encoder { … } func unmarshalJSONPb(data []byte, v interface{ … } func decodeJSONPb(d *json.Decoder, v interface{ … } func decodeNonProtoField(d *json.Decoder, v interface{ … } type protoEnum … var typeProtoMessage … // Delimiter for newline encoded JSON streams. func (j *JSONPb) Delimiter() []byte { … } var allowUnknownFields … // DisallowUnknownFields enables option in decoder (unmarshaller) to // return an error when it finds an unknown field. This function must be // called before using the JSON marshaller. func DisallowUnknownFields() { … }