Documentation ¶
Index ¶
- func Entries(s interface{}) map[string]interface{}
- func GetMethod(s interface{}, method string) reflect.Value
- func HasField(s interface{}, field string) bool
- func HasMethod(s interface{}, method string) bool
- func IsStruct(s interface{}) reflect.Value
- func Keys(s interface{}) []string
- func Methods(s interface{}) []string
- func Name(s interface{}) string
- func SetFieldValue(s interface{}, key string, value interface{})
- func Values(s interface{}) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Entries ¶
func Entries(s interface{}) map[string]interface{}
Entries returns a map where the keys are strings representing the names of fields in a structure and the values of these keys are interfaces representing the values of these fields.
func GetMethod ¶
GetMethod returns the Reflect.Value of a method of the structure obtained by name, if the method does not exist, it returns Reflect.Value of nil.
func HasField ¶
HasField returns a boolean that determines whether there is a field with the name received as a parameter within the structure.
func HasMethod ¶
HasMethod determines if there is a method with the name received as a parameter in the structure.
func IsStruct ¶
IsStruct validates whether the parameter is a valid structure or another type. Returns Reflect.Value of nil if not a valid structure, otherwise returns Reflect.Value of the received structure.
func Keys ¶
func Keys(s interface{}) []string
Keys returns an iterable list of strings with the names of fields in a structure.
func Methods ¶
func Methods(s interface{}) []string
Methods returns an iterable list of strings representing the names of a structure's methods.
func Name ¶
func Name(s interface{}) string
Name returns the name of the identifier of the structure passed as a parameter, if it is not a structure, it returns an empty string.
func SetFieldValue ¶
func SetFieldValue(s interface{}, key string, value interface{})
SetFieldValue sets the value of a field in a structure by name.
Types ¶
This section is empty.