github.com/nofeaturesonlybugs/jsmu (go): Package jsmu abstracts the typical 2-pass JSON encoding into what looks like a 1-pass JSON encoding step when marshalling or unmarshalling data.  Pronounce as j◦s◦mew.  Writing a general purpose JSON unmarshaller usually requires the following steps:  Writing a general purpose JSON marshaller works in reverse:  jsmu simply abstracts the above logic into a single marshal or unmarshal call as necessary and alleviates you from having to maintain large type switches, constructor tables, or whatever other mechanism you perform the above logic with.  jsmu requires that ConcreteType(s) be registered along with their TypeName and supports two conventions for supplying the TypeName.  You can embed a TypeName field directly into your struct:  Or you can pass a TypeName value during the call to Register():  Applications want to send messages.  In order for an endpoint to unpack an arbitrary message into a concrete type we need to send type information along with the message (this was referred to as TypeName above).  In other words the most basic message format becomes:  Conceptually we can think of this type wrapped around the "message" as the envelope.  jsmu allows you to use any custom type as an envelope by exposing and expecting the Enveloper interface:  If you leave the EnveloperFn field as nil then DefaultEnveloperFunc is used and your JSON needs to conform to the structure defined by Envelope.
Keywords: go|gob|golang|json|marshaller|marshalling