reflect

package
v0.0.0-...-602fb03 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFiledValue

func GetFiledValue(dest any, jsonpath string) (any, error)

GetFiledValue returns the field value of the struct field

func SetFiledValue

func SetFiledValue(dest any, jsonpath string, value any) error

StructFieldInfo returns the field name of the struct field

func SetStringAutoConvert

func SetStringAutoConvert(v reflect.Value, str string) error

func SetValueAutoConvert

func SetValueAutoConvert(v reflect.Value, value any) error

func StructFieldInfo

func StructFieldInfo(structField reflect.StructField) (bool, bool, string)

Types

type KV

type KV struct {
	Key   string
	Value interface{}
}

func ToJsonPathes

func ToJsonPathes(prefix string, nodes []Node) []KV

type Node

type Node struct {
	Name   string
	Kind   reflect.Kind
	Tag    reflect.StructTag
	Value  reflect.Value
	Fields []Node
}

func ParseStruct

func ParseStruct(data interface{}) Node

Jump to

Keyboard shortcuts

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