Documentation
¶
Index ¶
- func ConvertType[T any](value interface{}) (T, error)
- func DeepCopy[T any](src T) (T, error)
- func DeepMerge(objects ...map[string]interface{}) map[string]interface{}
- func DeleteValue(jsonData map[string]interface{}, path string) error
- func Equal(a, b interface{}) bool
- func Flatten(data map[string]interface{}) map[string]interface{}
- func FromJSON[T any](jsonStr string) (T, error)
- func FromMap[T any](data map[string]interface{}) (T, error)
- func GetArray(data map[string]interface{}, key string) ([]interface{}, error)
- func GetBool(data map[string]interface{}, key string) (bool, error)
- func GetFloat(data map[string]interface{}, key string) (float64, error)
- func GetInt(data map[string]interface{}, key string) (int, error)
- func GetObject(data map[string]interface{}, key string) (map[string]interface{}, error)
- func GetString(data map[string]interface{}, key string) (string, error)
- func GetValue(jsonData map[string]interface{}, path string) (interface{}, error)
- func HasPath(jsonData map[string]interface{}, path string) bool
- func IsValidJSON(jsonStr string) bool
- func Keys(data map[string]interface{}) []string
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func MarshalPretty(v interface{}) ([]byte, error)
- func Merge(objects ...map[string]interface{}) map[string]interface{}
- func Minify(jsonBytes []byte) ([]byte, error)
- func MinifyString(jsonStr string) (string, error)
- func SetValue(jsonData map[string]interface{}, path string, value interface{}) error
- func Size(data interface{}) int
- func ToJSON(v interface{}) (string, error)
- func ToMap(v interface{}) (map[string]interface{}, error)
- func ToPrettyJSON(v interface{}) (string, error)
- func Unflatten(flat map[string]interface{}) map[string]interface{}
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalFromReader(reader io.Reader, v interface{}) error
- func UnmarshalFromString(jsonStr string, v interface{}) error
- func Values(data map[string]interface{}) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertType ¶
ConvertType converts a value to the specified type using JSON round-trip
func DeleteValue ¶
DeleteValue deletes a value from JSON using dot notation path
func IsValidJSON ¶
IsValidJSON checks if a string is valid JSON
func MarshalIndent ¶
MarshalIndent marshals v to JSON with indentation
func MarshalPretty ¶
MarshalPretty marshals v to pretty-printed JSON
func MinifyString ¶
MinifyString removes unnecessary whitespace from JSON string
func Size ¶
func Size(data interface{}) int
Size returns the size of JSON data (number of keys for objects, length for arrays)
func ToPrettyJSON ¶
ToPrettyJSON converts any value to pretty JSON string
func UnmarshalFromReader ¶
UnmarshalFromReader unmarshals JSON from io.Reader into v
func UnmarshalFromString ¶
UnmarshalFromString unmarshals JSON string into v
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.