Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Transform ¶
func Transform(j []byte, f *JSONFields) ([]byte, error)
Transform performs the following: 1. Cehrry pick only fields we want by the fields specifier when given a json string, I cannot cherry pick struct, because I can't make it generic enough to fit all models Then that means I have to loop the array to json marshal it 2. Transform the value if necessary (used to be called JSONCherryPickFields)
Types ¶
type JSONFieldEmptyList ¶
type JSONFieldEmptyList bool
JSONFieldEmptyList is defined for field should be an empty list if no value exists
type JSONFieldEmptyString ¶
type JSONFieldEmptyString bool
JSONFieldEmptyString is defined for field should be an empty string if no value exists
type JSONFieldIgnoreIfEmpty ¶
type JSONFieldIgnoreIfEmpty bool
JSONFieldIgnoreIfEmpty is defined for field that should not be in the JSON if no value exists
type JSONFields ¶
type JSONFields map[string]interface{}
JSONFields is the fields we specify to pick out only the JSON fields we want