Marshal marshals "value" into Proto
(value interface{})
| 17 | |
| 18 | // Marshal marshals "value" into Proto |
| 19 | func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) { |
| 20 | message, ok := value.(proto.Message) |
| 21 | if !ok { |
| 22 | return nil, errors.New("unable to marshal non proto field") |
| 23 | } |
| 24 | return proto.Marshal(message) |
| 25 | } |
| 26 | |
| 27 | // Unmarshal unmarshals proto "data" into "value" |
| 28 | func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { |