Code Monkey home page Code Monkey logo

ubjson's People

Contributors

jmank88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ubjson's Issues

Struct Tag Support

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).

Code Generation

A command line program to generate Value code for structs (tagged or not) would offer some benefits:

  • Simpler and less error prone than writing by hand (even if only 'as good', or used as a starting point for hand edits)
  • Container optimization without sacrificing runtime speed (static field mappings, counts, strong types, arrays, ordered fields)

The simplest form might look like ubjsonvalue -type=CustomValue, and be called on demand or from go:generate.

Unknown UBJSON fields should be ignored when unmarshalling

@jmank88 I was wondering what your thoughts were on fields that are in the UBJSON object but not declared in the Go struct.
Currently, I see the error: unable to decode entry: no field found named/tagged ...
When I do the same test using encoding/json, the 'unknown' JSON field is consumed and discarded.

A use case is to implement forward compatibility with UBJSON messages.
I can add a failing test if you'd like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.