reflect

package
v0.0.0-...-2e9e358 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(toValue interface{}, fromValue interface{}) (err error)

from https://github.com/jinzhu/copier Copy copy things

func CopyStruct

func CopyStruct(target interface{}, src interface{})

func GetStructField

func GetStructField(v interface{}, field string, caseSensitive ...bool) reflect.Value

func GetStructFieldInfoMap

func GetStructFieldInfoMap(v interface{}, structColsParams ...*StructSelCols) (ret map[string]FieldInfo)

func GetStructFieldInfoMap2

func GetStructFieldInfoMap2(v interface{}, ret map[string]FieldInfo, structColsParams ...*StructSelCols) map[string]FieldInfo

func GetStructFieldMap

func GetStructFieldMap(v interface{}, structColsParams ...*StructSelCols) (ret map[string]reflect.Value)

func GetStructFieldName2ValueMap

func GetStructFieldName2ValueMap(v interface{}, structColsParams ...*StructSelCols) (ret map[string]interface{})

func GetStructFieldNames

func GetStructFieldNames(v interface{}, structColsParams ...*StructSelCols) (ret []string)

func GetStructFieldSimple

func GetStructFieldSimple(val reflect.Value, field string, caseSensitive bool) reflect.Value

func GetStructFieldToString

func GetStructFieldToString(ob interface{}, field string, caseSensitive ...bool) string

func GetStructFieldValue

func GetStructFieldValue(v interface{}, field string, caseSensitive ...bool) interface{}

func GetStructFieldValueSimple

func GetStructFieldValueSimple(v interface{}, field string, caseSensitive bool) interface{}

func GetStructMethod

func GetStructMethod(v interface{}, field string) interface{}

func GetStructMethodSimple

func GetStructMethodSimple(v interface{}, method string) interface{}

func SetStructFieldValue

func SetStructFieldValue(obj interface{}, field string, v interface{}, caseSensitive ...bool) bool

Types

type FieldInfo

type FieldInfo struct {
	Tag reflect.StructTag
	Val reflect.Value
}

type StructSelCols

type StructSelCols struct {
	IncludeCols []string
	ExcludeCols []string
}

Jump to

Keyboard shortcuts

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