json

package
v1.127.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(m utils.JSON) utils.JSON

func DeepMerge

func DeepMerge(x1, x2 utils.JSON) utils.JSON

func DeepMerge2

func DeepMerge2(x1, x2 utils.JSON) utils.JSON

func Encapsulate

func Encapsulate(envelopeName string, data utils.JSON) utils.JSON

func GetBool

func GetBool(kv utils.JSON, k string) (bool, error)

func GetBoolWithDefault

func GetBoolWithDefault(kv utils.JSON, k string, defaultValue bool) bool

func GetFloat32

func GetFloat32(kv utils.JSON, k string) (v float32, err error)

func GetFloat64

func GetFloat64(kv utils.JSON, k string) (v float64, err error)

func GetInt

func GetInt(kv utils.JSON, k string) (v int, err error)

func GetInt64

func GetInt64(kv utils.JSON, k string) (v int64, err error)

func GetInt64WithDefault

func GetInt64WithDefault(kv utils.JSON, k string, defaultValue int64) (v int64, err error)

func GetIntWithDefault

func GetIntWithDefault(kv utils.JSON, k string, defaultValue int) (v int, err error)

func GetNumber

func GetNumber[A Number](kv utils.JSON, k string) (v A, err error)

func GetNumberWithDefault

func GetNumberWithDefault[A Number](kv utils.JSON, k string, defaultValue A) (v A)

func GetString

func GetString(kv utils.JSON, k string) (v string, err error)

func GetTime

func GetTime(kv utils.JSON, k string) (v time.Time, err error)

func GetValueWithFieldPathString

func GetValueWithFieldPathString(fieldPath string, data utils.JSON) (any, error)

func MapStringStringCopy

func MapStringStringCopy(m map[string]string) map[string]string

func MarshalableMerge

func MarshalableMerge(x1, x2 any) (any, error)

MarshalableMerge merges the two JSON-marshalable values x1 and x2, preferring x1 over x2 except where x1 and x2 are JSON objects, in which case the keys from both objects are included and their values merged recursively.

It returns an error if x1 or x2 cannot be JSON-marshaled.

func MustGetInt64

func MustGetInt64(kv utils.JSON, k string) (v int64)

func PrettyPrint

func PrettyPrint(v utils.JSON) (string, error)

func ReplaceMergeMap

func ReplaceMergeMap(m1 utils.JSON, m2 utils.JSON) utils.JSON

func ResponseBodyToJSON

func ResponseBodyToJSON(r *http.Response) (utils.JSON, error)

Types

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | float32 | float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL