Documentation ¶
Index ¶
- func AddCustomFields(obj map[string]interface{}, cf map[string]interface{})
- func CopyExcept(json map[string]interface{}, flds ...string) map[string]interface{}
- func MarshalWithCustomFields(v interface{}, cf map[string]interface{}) ([]byte, error)
- func MergeCustomFields(v interface{}, cf map[string]interface{}) (map[string]interface{}, error)
- func Select(json map[string]interface{}, flds ...string) map[string]interface{}
- func ShallowCopyObj(json map[string]interface{}) map[string]interface{}
- func SplitJSONObj(json map[string]interface{}, flds ...string) (map[string]interface{}, map[string]interface{})
- func ToMap(v interface{}) (map[string]interface{}, error)
- func UnmarshalWithCustomFields(data []byte, v interface{}, cf map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCustomFields ¶ added in v1.1.0
AddCustomFields add custom filed to json object.
func CopyExcept ¶ added in v1.1.0
CopyExcept copies all fields except fields with given names.
func MarshalWithCustomFields ¶
MarshalWithCustomFields marshals value merged with custom fields defined in the map into JSON bytes.
func MergeCustomFields ¶
MergeCustomFields converts value to the JSON-like map and merges it with custom fields map cf.
func ShallowCopyObj ¶ added in v1.1.0
ShallowCopyObj creates new json object with copied fields form provided object.
func SplitJSONObj ¶ added in v1.1.0
func SplitJSONObj(json map[string]interface{}, flds ...string) (map[string]interface{}, map[string]interface{})
SplitJSONObj splits provides fields into separate object.
func UnmarshalWithCustomFields ¶
UnmarshalWithCustomFields unmarshals JSON into value v and puts all JSON fields which do not belong to value into custom fields map cf.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.