Skip to content

Conversation

@moodyjon
Copy link
Contributor

@moodyjon moodyjon commented Nov 10, 2022

Context: lbryio/types#49

This based on #3697, but moving away from protobuf.Any. This allows deleting some code to detect unknown extension types and the code to unpack a message from the Any.

I also discovered that there is a well-known type protobuf.Struct which is far more advanced than my StringMap but serves the same purpose. The backbone of protobuf.Struct is a map<string, Value> just like StringMap, but protobuf.Struct can represent any JSON object with numeric fields, bool fields, string fields, list of X fields, object fields, and more. Using this allowed even more simplification.

Definition of google.protobuf.Struct:
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/struct.proto

To see the claim.proto changes go here:
https://github.com/moodyjon/types/commits/repost_modify

Hub changes that would index the extension fields are here: lbryio/hub#113

@coveralls
Copy link

coveralls commented Nov 10, 2022

Coverage Status

Coverage decreased (-0.6%) to 56.057% when pulling 4f1d82a on moodyjon:stringmap_extensions into 6258651 on lbryio:master.

@moodyjon moodyjon force-pushed the stringmap_extensions branch from afd708b to 4f1d82a Compare December 14, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants