anyutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Field

func Field(v any, fieldName string) reflect.Value

Field 根据结构体的字段名获取结构体字段的Value,如果v不是结构体返回空Value

func FieldByIndex

func FieldByIndex(v any, index int) reflect.Value

FieldByIndex 获取指定值的指定索引的Field

func FieldByName

func FieldByName(v any, field string) reflect.Value

FieldByName 根据结构体的字段名获取Field

func Fields

func Fields(v any) []reflect.Value

Fields 获取结构体的所有Field

func InvokeMethod

func InvokeMethod(v any, methodName string, param ...any) []any

func IsArray

func IsArray(v any) bool

func IsNil

func IsNil(v any) bool

func IsNotNil

func IsNotNil(v any) bool

func IsSlice

func IsSlice(v any) bool

func IsStruct

func IsStruct(v any) bool

func Kind

func Kind(v any) reflect.Kind

Kind 获取指定值的类型的分类

func MethodByName

func MethodByName(v any, methodName string) reflect.Value

func Methods

func Methods(v any) []reflect.Value

func RealKind

func RealKind(v any) reflect.Kind

RealKind 获取指针的类型的分类

func SliceType

func SliceType(v any) reflect.Type

SliceType 获取切片的类型

func StructField

func StructField(v any, index int) reflect.StructField

func StructFieldByName

func StructFieldByName(v any, name string) reflect.StructField

func StructFieldKinds

func StructFieldKinds(v any) []reflect.Kind

StructFieldKinds 获取结构体的所有Field的Kind

func StructFieldNames

func StructFieldNames(v any) []string

StructFieldNames 获取结构体的所有字段名

func StructFieldTag

func StructFieldTag(v any, field, key string) string

StructFieldTag 获取结构的指定字段的标签

func StructFields

func StructFields(v any) []reflect.StructField

func StructNumField

func StructNumField(v any) int

StructNumField 获取结构体的字段数量

func Type

func Type(v any) reflect.Type

Type 获取指定值的类型

func Value

func Value(v any) reflect.Value

Value 获取指定值的反射值

Types

This section is empty.

Jump to

Keyboard shortcuts

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