-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Struct Tag Support #2
Comments
Hi Jordan, are you still interested in implementing some support for field tags? I cannot use auto decoding when all my keys are lower case strings. I would be willing to take on this issue. |
Yes, I'm still interested in this. I didn't have firm plans for this when I wrote it up, so it may need some more design up front. One thing I was wondering was if it make sense (and is it possible) to leverage the same Also related is #6. If there is a significant speed boost, it'd be neat to generate You are welcome to work on this issue. Feel free to put a WIP pull request, or let me know if you get stuck or need any help. |
@peergynt, have you started on this issue? If not, I prototyped something that I can put up soon. |
I did not really start anything yet. This is kind of a side-project of a side-project... I was thinking that the As far as the design, I was thinking about imitating the 'encoding/json' implementation (i.e. tag caching...). In any case, let me know what I can help with. |
@peergynt I put up #8, if you'd like to take a look or test the branch. After thinking more about it, the duplication from having a separate 'ubjson' tag isn't such a big deal, plus recognizing 'json' first could potentially force people to add an additional 'ubjson' tag just to get back to the original field name. |
@jmank88 I tested the struct_tag branch and the ubjson tag seems to work well! |
Closing this since basic support has been added. Can revisit if more options/extensions are needed later on. |
Support basic
json
struct tags, and any relevant options (e.g.omitempty
).Consider an option for alternate type encoding (e.g. tag a byte with 'C', rather than use a
Char
type).Keep an eye on the benchmarks - consider caching struct type info on the first run (fields, tags, counts, etc).
The text was updated successfully, but these errors were encountered: