You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 12, 2019. It is now read-only.
Right now, deStruct traverses fields recursively, makes copies, scalars, and children objects. This is rather difficult, and complex. We really shouldn't try to maintain near identical copies of the input data. Instead we should convert it to a basic, but simple interface all handlers can consume.
One option:
Redo this so that there are no copies, and all objects are converted into a field type. The field should have:
Type method which indicates the original type of the field
Name the key for the field
Scalar method which returns a scalar value
String method which returns a string of the scalar value
SubFields method which returns a nested map of sub fields
Fields method which returns a flattened map of sub fields, including the field itself
Right now,
deStructtraverses fields recursively, makes copies, scalars, and children objects. This is rather difficult, and complex. We really shouldn't try to maintain near identical copies of the input data. Instead we should convert it to a basic, but simple interface all handlers can consume.One option:
Redo this so that there are no copies, and all objects are converted into a
fieldtype. Thefieldshould have:Typemethod which indicates the original type of the fieldNamethe key for the fieldScalarmethod which returns a scalar valueStringmethod which returns a string of the scalar valueSubFieldsmethod which returns a nested map of sub fieldsFieldsmethod which returns a flattened map of sub fields, including the field itselfMarshalJSONself explanatory