jsonFieldKit

package
v3.0.908 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetField func(jsonData []byte, path string) gjson.Result = gjson.GetBytes

GetField

@param path 如果是嵌套的内部字段,可以通过'.'组合

字段类型判断:

Result.Type
Result.IsBool()
Result.IsArray()
Result.IsObject()
View Source
var GetFieldFromString func(json, path string) gjson.Result = gjson.Get

Functions

func GetBoolField

func GetBoolField(jsonData []byte, path string) bool

func GetBoolFieldFromString

func GetBoolFieldFromString(jsonStr, path string) bool

func GetBoolSliceField

func GetBoolSliceField(jsonData []byte, path string) (s []bool)

func GetBoolSliceFieldFromString

func GetBoolSliceFieldFromString(jsonStr, path string) (s []bool)

func GetFloat64Field

func GetFloat64Field(jsonData []byte, path string) float64

func GetFloat64FieldFromString

func GetFloat64FieldFromString(jsonStr, path string) float64

func GetFloat64SliceField

func GetFloat64SliceField(jsonData []byte, path string) (s []float64)

func GetFloat64SliceFieldFromString

func GetFloat64SliceFieldFromString(jsonStr, path string) (s []float64)

func GetInt64Field

func GetInt64Field(jsonData []byte, path string) int64

func GetInt64FieldFromString

func GetInt64FieldFromString(jsonStr, path string) int64

func GetInt64SliceField

func GetInt64SliceField(jsonData []byte, path string) (s []int64)

func GetInt64SliceFieldFromString

func GetInt64SliceFieldFromString(jsonStr, path string) (s []int64)

func GetStringField

func GetStringField(jsonData []byte, path string) string

func GetStringFieldFromString

func GetStringFieldFromString(jsonStr, path string) string

func GetStringSliceField

func GetStringSliceField(jsonData []byte, path string) (s []string)

func GetStringSliceFieldFromString

func GetStringSliceFieldFromString(jsonStr, path string) (s []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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