drpc icon indicating copy to clipboard operation
drpc copied to clipboard

Support for custom codec?

Open ccnlui opened this issue 3 years ago • 2 comments

Is there any support for using other codec other than protobufs? How would you implement a server using a custom codec?

ccnlui avatar Jun 22 '22 14:06 ccnlui

Yep, that's what the Encoding type is supposed to abstract.

The code generator still requires a proto service definition and message types, but you can use the protolib option to specify an import path (for example, this specifies the import path of storj.io/drpc/internal/integration/customencoding) to a package that contains top level Marshal and Unmarshal functions (for example, this just dispatches to protobuf again, but you can do whatever you want here).

Do you have a specific encoding you want to use? I can try to figure out some more of the details if you have a concrete encoding in mind already.

zeebo avatar Jun 28 '22 14:06 zeebo

Thanks for the tips. I'm thinking of using flatbuffers with drpc, if that's possible.

ccnlui avatar Jun 28 '22 15:06 ccnlui

I'm going to close this out. If you did make it work with flatbuffers in a way that can be shared, I'd love to see it!

zeebo avatar Sep 22 '22 13:09 zeebo

Thanks for the tips. I'm thinking of using flatbuffers with drpc, if that's possible.

were you able to try it? please share the documentation, if you've created any. Thanks

santakdalai90 avatar Nov 25 '22 18:11 santakdalai90