Documentation
¶
Index ¶
- func ConvertInterfaceNumbers(v *interface{}, depth int) error
- func ConvertMapNumbers(m map[string]interface{}, depth int) error
- func ConvertSliceNumbers(s []interface{}, depth int) error
- func DeepCopyJSON(x map[string]interface{}) map[string]interface{}
- func DeepCopyJSONValue(x interface{}) interface{}
- func ExtractTag(s interface{}, field string, jsonTag ...string) (tag string, inline, exists bool)
- func Filter(obj map[string]interface{}, filter map[string]interface{}) (map[string]interface{}, error)
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func NewEncoder(w io.Writer) *json.Encoder
- func ParseTag(in string) (tag string, inline, exists bool)
- func Unmarshal(data []byte, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertInterfaceNumbers ¶
ConvertInterfaceNumbers converts any json.Number values to int64 or float64. Values which are map[string]interface{} or []interface{} are recursively visited
func ConvertMapNumbers ¶
ConvertMapNumbers traverses the map, converting any json.Number values to int64 or float64. values which are map[string]interface{} or []interface{} are recursively visited
func ConvertSliceNumbers ¶
ConvertSliceNumbers traverses the slice, converting any json.Number values to int64 or float64. values which are map[string]interface{} or []interface{} are recursively visited
func DeepCopyJSON ¶ added in v0.0.4
DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func DeepCopyJSONValue ¶ added in v0.0.4
func DeepCopyJSONValue(x interface{}) interface{}
DeepCopyJSONValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func ExtractTag ¶ added in v0.0.4
func Marshal ¶
Marshal delegates to json.Marshal It is only here so this package can be a drop-in for common encoding/json uses
func MarshalIndent ¶
MarshalIndent delegates to json.MarshalIndent It is only here so this package can be a drop-in for common encoding/json uses
func NewEncoder ¶
NewEncoder delegates to json.NewEncoder It is only here so this package can be a drop-in for common encoding/json uses
Types ¶
This section is empty.