At the moment picobuf.Marshal and picobuf.Unmarshal expect messages of type picobuf.Message, which has some specific methods. However, drpc endpoints create typedefinitions such as:
type drpcEncoding_File_certificate_proto struct{}
func (drpcEncoding_File_certificate_proto) Marshal(msg drpc.Message) ([]byte, error) {
return picobuf.Marshal(msg)
}
func (drpcEncoding_File_certificate_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return picobuf.Unmarshal(buf, msg)
}
func (c *drpcCertificatesClient) Sign(ctx context.Context, in *SigningRequest) (*SigningResponse, error) {
out := new(SigningResponse)
err := c.cc.Invoke(ctx, "/node.Certificates/Sign", drpcEncoding_File_certificate_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
I would expect the Invoke to register with a more specific message such as picobuf.Message instead of relying on drpc.Message and expecting that Marshal and Unmarshal don't have additional constraints.
At the moment
picobuf.Marshalandpicobuf.Unmarshalexpect messages of typepicobuf.Message, which has some specific methods. However,drpcendpoints create typedefinitions such as:I would expect the
Invoketo register with a more specific message such aspicobuf.Messageinstead of relying ondrpc.Messageand expecting thatMarshalandUnmarshaldon't have additional constraints.