Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenJSON ¶
FlattenJSON generates a new JSON string with keys flattened.
Given the following JSON string:
{ name: {
first_name: 'John',
last_name: 'Doe'
}}
It generates the following JSON string:
{'name.first_name': 'John', 'name.last_name': 'Doe'}
func UnflattenJSON ¶
UnflattenJSON unflattens a flat JSON string and returns it to the caller as a new flat JSON string.
Types ¶
type ResultMap ¶
type ResultMap map[string]interface{}
ResultMap map type returned/consumed by the library
func FlattenMap ¶
FlattenMap generates a new map with keys flattened.
Given the following JSON string:
{ name: {
first_name: 'John',
last_name: 'Doe',
experiences: [
{
year: {start: 2000, end: 2003},
position: 'programmer',
company: 'acme'
}
]
}}
It generates the following map:
map[string]interface{} {
"name.first_name": "John",
"name.last_name": "Doe",
"experiences": []map[string]interface{} {
map[string]interface{} {
"year.start": 2000,
"year.end": 2003,
"position": "programmer",
"company": "acme",
},
}
}
func UnflattenMap ¶
UnflattenMap unflattens a flat map.
Click to show internal directories.
Click to hide internal directories.