elixir-protobuf / google-protos

Elixir files generated from Google's protobuf files using protobuf-elixir
MIT License
16 stars 21 forks source link

Add Google.Protobuf.Any.Codec module #4

Closed matehat closed 5 years ago

matehat commented 5 years ago

This new module provides pack/1 and unpack/2 functions to manipulate google.protobuf.Any structs. This follows the equivalent Python API.

This PR depends on https://github.com/tony612/protobuf-elixir/pull/54

matehat commented 5 years ago

@tony612 any chance this and tony612/protobuf-elixir#54 can be reviewed and merged?

tony612 commented 5 years ago

I don't understand why you want to add this. You can write a module by yourself in your code.

matehat commented 5 years ago

Language implementations of the google. messages need to support the google.protobuf.Any message. This message is useless if you don't provide the canonical Pack() and Unpack() equivalent. It's what the google.protobuf.Any type is used for. If your library provides the structure, it needs to provide the code to manipulate it don't you think?

isaacsanders commented 5 years ago

I think this documentation is why @matehat made this PR: https://developers.google.com/protocol-buffers/docs/proto3#any

This says that libraries should provide this.

If you (@tony612) have your own use case for this software, and don't want to/can't devote time to supporting the use case that others have, I think there might be interest in helping to build/maintain new features.

matehat commented 5 years ago

@isaacsanders @tony612 yep, I'd be up for it. Our company uses protobuf extensively through Elixir, Python and Dart, and we'd definitely be able to sponsor work into this particular library when needs arise.

jdemilledt commented 5 years ago

@matehat @isaacsanders As @demilletech has a use for Protobuf in Elixir, we have made a fork we plan to maintain. Feel free to reopen this PR there.