Documentation
¶
Index ¶
- func DiffObject(old interface{}, new interface{}, option UpdateJsonOption) interface{}
- func ExtractObjectJMES(old interface{}, pathKey, path string) interface{}
- func IsEmptyObject(v interface{}) bool
- func LastSegment(input string) string
- func MergeObject(old interface{}, new interface{}) interface{}
- func NormalizeJson(input interface{}) string
- func ResponseErrorWasNotFound(err error) bool
- func ResponseErrorWasStatusCode(err error, statusCode int) bool
- func UpdateObject(old interface{}, new interface{}, option UpdateJsonOption) interface{}
- type UpdateJsonOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffObject ¶ added in v0.2.0
func DiffObject(old interface{}, new interface{}, option UpdateJsonOption) interface{}
DiffObject computes a minimal patch that transforms old -> new. It returns: - nil if there are no changes - a map[string]interface{} with only changed fields for objects - a full new array for arrays when they differ - the new primitive value for scalars when they differ
func ExtractObjectJMES ¶
func ExtractObjectJMES(old interface{}, pathKey, path string) interface{}
ExtractObjectJMES is used to extract object from old using JMES path
func IsEmptyObject ¶ added in v0.2.0
func IsEmptyObject(v interface{}) bool
IsEmptyObject returns true if the input should be considered an empty patch
func LastSegment ¶ added in v0.2.0
func MergeObject ¶
func MergeObject(old interface{}, new interface{}) interface{}
MergeObject is used to merge object old and new, if overlaps, use new value
func NormalizeJson ¶
func NormalizeJson(input interface{}) string
func UpdateObject ¶ added in v0.2.0
func UpdateObject(old interface{}, new interface{}, option UpdateJsonOption) interface{}
UpdateObject is used to get an updated object which has same schema as old, but with new value
Types ¶
type UpdateJsonOption ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.