Documentation
¶
Index ¶
- func AddProperty(original_data map[string]interface{}, path string, value interface{}, ...) (err error)
- func DeleteProperty(original_data map[string]interface{}, path string, separator_arr ...string) (err error)
- func GetProperty(original_data map[string]interface{}, path string, separator_arr ...string) (path_parsed interface{}, err error)
- func UpdateProperty(original_data map[string]interface{}, path string, value interface{}, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProperty ¶
func AddProperty(original_data map[string]interface{}, path string, value interface{}, separator_arr ...string) (err error)
AddProperty adds a property to map. Returns an error if property already exists
err := AddProperty(document, "one.two.three[0]", "string value") err := AddProperty(document, "one.two.three[0]", "string value", ".") err := AddProperty(document, "one/two/three[0]", "string value", "/")
func DeleteProperty ¶
func DeleteProperty(original_data map[string]interface{}, path string, separator_arr ...string) (err error)
DeleteProperty removes a property from map
err := DeleteProperty(document, "one.two.three[0]") err := DeleteProperty(document, "one.two.three[0]", ".") err := DeleteProperty(document, "one/two/three[0]", "/")
func GetProperty ¶
func GetProperty(original_data map[string]interface{}, path string, separator_arr ...string) (path_parsed interface{}, err error)
GetProperty returns a property if it exist.
property, err := GetProperty(document, "one.two.three[0]") property, err := GetProperty(document, "one.two.three[0]", ".") property, err := GetProperty(document, "one/two/three[0]", "/")
Property type is `interface{}`
func UpdateProperty ¶
func UpdateProperty(original_data map[string]interface{}, path string, value interface{}, separator_arr ...string) (err error)
UpdateProperty updates a property in a map. It will create or update existing property
err := UpdateProperty(document, "one.two.three[0]", "string value") err := UpdateProperty(document, "one.two.three[0]", "string value", ".") err := UpdateProperty(document, "one/two/three[0]", "string value", "/")
Types ¶
This section is empty.