Documentation
¶
Index ¶
- func Name(s interface{}) (string, error)
- func Names(s interface{}, tag ...string) ([]string, error)
- type StructField
- func (s *StructField) CanSet() bool
- func (s *StructField) IsZero() bool
- func (s *StructField) Kind() reflect.Kind
- func (s *StructField) Name() string
- func (s *StructField) ReflectField() reflect.StructField
- func (s *StructField) ReflectValue() reflect.Value
- func (s *StructField) Set(v interface{}) error
- func (s *StructField) Tag(k string) string
- func (s *StructField) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StructField ¶
type StructField struct {
// contains filtered or unexported fields
}
StructField represents a field.
func Field ¶
func Field(s interface{}, n string) (*StructField, error)
Field returns a field from a struct by name.
func Fields ¶
func Fields(s interface{}, tag ...string) ([]*StructField, error)
Fields returns a list field. Tag argument is optional.
func (*StructField) CanSet ¶
func (s *StructField) CanSet() bool
CanSet reports whether the value can be changed.
func (*StructField) IsZero ¶
func (s *StructField) IsZero() bool
IsZero reports whether a value is a zero value of its kind.
func (*StructField) ReflectField ¶
func (s *StructField) ReflectField() reflect.StructField
ReflectField returns the reflect struct field.
func (*StructField) ReflectValue ¶
func (s *StructField) ReflectValue() reflect.Value
ReflectValue returns the reflect field value.
func (*StructField) Set ¶
func (s *StructField) Set(v interface{}) error
Set sets the field value only if field is exported and can be set.
func (*StructField) Tag ¶
func (s *StructField) Tag(k string) string
Tag returns a field tag value by key or a empty string.
func (*StructField) Value ¶
func (s *StructField) Value() interface{}
Value returns the field value.
Click to show internal directories.
Click to hide internal directories.