JSONPBMarshaler is implemented by protobuf messages that customize the way they are marshaled to JSON. Messages that implement this should also implement JSONPBUnmarshaler so that the custom format can be parsed. The JSON marshaling must follow the proto to JSON specification: https://developers.
| 60 | // |
| 61 | // Deprecated: Custom types should implement protobuf reflection instead. |
| 62 | type JSONPBMarshaler interface { |
| 63 | MarshalJSONPB(*Marshaler) ([]byte, error) |
| 64 | } |
| 65 | |
| 66 | // Marshal serializes a protobuf message as JSON into w. |
| 67 | func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { |
no outgoing calls
no test coverage detected