Unmarshal unmarshals proto "data" into "value"
(data []byte, value interface{})
| 26 | |
| 27 | // Unmarshal unmarshals proto "data" into "value" |
| 28 | func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { |
| 29 | message, ok := value.(proto.Message) |
| 30 | if !ok { |
| 31 | return errors.New("unable to unmarshal non proto field") |
| 32 | } |
| 33 | return proto.Unmarshal(data, message) |
| 34 | } |
| 35 | |
| 36 | // NewDecoder returns a Decoder which reads proto stream from "reader". |
| 37 | func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder { |