Documentation ¶
Index ¶
- func Call(i interface{}, methodName string, methodArgs ...interface{}) (result []interface{}, err error)
- func Field(i interface{}, fieldName string) (field reflect.Value, err error)
- func FieldInterfaces(v reflect.Value) (map[string]interface{}, error)
- func FieldNames(t reflect.Type, anonymous bool) (names []string, err error)
- func FieldTags(t reflect.Type, tagKey string) (map[string]string, error)
- func HasAnyType(v reflect.Type, types []reflect.Kind) bool
- func HasPtr(v reflect.Value) bool
- func HasSlice(v reflect.Value) bool
- func HasString(v reflect.Value) bool
- func HasStruct(v reflect.Value) bool
- func Indirect(i interface{}) (v reflect.Value)
- func Interface(i interface{}, fieldName string) (interface{}, error)
- func Interfaces(i interface{}) (map[string]interface{}, error)
- func IsAnyType(i interface{}, types []reflect.Kind) bool
- func IsField(i interface{}, fieldName string) (bool, error)
- func IsPtr(i interface{}) bool
- func IsSlice(i interface{}) bool
- func IsString(i interface{}) bool
- func IsStruct(i interface{}) bool
- func IsStructOrStructPtr(i interface{}) bool
- func IsStructPtr(i interface{}) bool
- func IsTag(i interface{}, fieldName, tagKey string) (bool, error)
- func Kind(i interface{}, fieldName string) (reflect.Kind, error)
- func MakeSlice(i interface{}, len, cap int) interface{}
- func Method(i interface{}, methodName string) (method reflect.Value, err error)
- func Names(i interface{}, anonymous bool) ([]string, error)
- func Set(i interface{}, fieldName string, value interface{}) error
- func StructField(i interface{}, fieldName string) (field reflect.StructField, err error)
- func Tag(i interface{}, fieldName, tagKey string) (string, error)
- func Tags(i interface{}, tagKey string) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
func Call(i interface{}, methodName string, methodArgs ...interface{}) (result []interface{}, err error)
Call calls the function i with the input arguments.
func FieldInterfaces ¶
FieldInterfaces returns the field - value struct pairs as a map.
func FieldNames ¶
FieldNames returns the struct fields names list. If anonymous is true that contains the field names anonymous.
func HasAnyType ¶
HasAnyType returns true if any type in types are within v.
func Indirect ¶
Indirect returns the value that i points to. If i is a nil pointer, Indirect returns a zero Value. If i is not a pointer, Indirect returns i.
func Interface ¶
Interface returns i's current value as an interface{}. It error if the Value was obtained by accessing unexported struct fields.
func Interfaces ¶
Interfaces returns the field - value struct pairs as a map. It error if i's Kind is not Struct or Ptr.
func IsField ¶
IsField checks if i field name is part of a struct. It error if i's Kind is not Struct or Ptr.
func IsStructOrStructPtr ¶
func IsStructOrStructPtr(i interface{}) bool
IsStructOrStructPtr returns true if i is of type struct or struct pointer.
func IsStructPtr ¶
func IsStructPtr(i interface{}) bool
IsStructPtr returns true if i is of type struct pointer.
func IsTag ¶
IsTag checks if i field tag is part of a struct. It error if i's Kind is not Struct or Ptr.
func Kind ¶
Kind returns i's Kind. If i is the zero Value (IsValid returns false), Kind returns Invalid.
func MakeSlice ¶
func MakeSlice(i interface{}, len, cap int) interface{}
MakeSlice creates a new zero-initialized slice value for the specified slice type, length, and capacity.
func Names ¶
Names returns the struct fields names list. It error if i's Kind is not Struct or Ptr. If anonymous is true that contains the field names anonymous.
func Set ¶
Set assigns value to the interface{} i. It error if CanSet returns false. As in Go, value's interface{} must be assignable to i's type.
func StructField ¶
func StructField(i interface{}, fieldName string) (field reflect.StructField, err error)
StructField returns i's reflect.StructField. It error if i's Kind is not Struct or Ptr.
Types ¶
This section is empty.