MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / Unmarshal

Method Unmarshal

runtime/marshal_proto.go:28–34  ·  view source on GitHub ↗

Unmarshal unmarshals proto "data" into "value"

(data []byte, value interface{})

Source from the content-addressed store, hash-verified

26
27// Unmarshal unmarshals proto "data" into "value"
28func (*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".
37func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder {

Callers 2

NewDecoderMethod · 0.95

Calls 1

UnmarshalMethod · 0.65

Tested by 1