Documentation ¶
Index ¶
- Variables
- func CanExpand(t reflect.Type) bool
- func CanInline(t reflect.Type) bool
- func CheckExistsField(typeName, fieldName string) (index int, exists bool)
- func GetFieldTypName(typName, fieldName string) string
- func GetInterfaceField(v reflect.Value, i int) reflect.Value
- func GetStructTag(field reflect.StructField) (tagValue string)
- func IsLabelType(t reflect.Type) bool
- func MapToStruct(from map[string]interface{}, obj interface{}) error
- func MapTypStruct(from map[string]interface{}, t *Typer) error
- func Nonzero(v reflect.Value) bool
- func Register(obj interface{}) error
- func SetStructFidld(typName, tag string, fValue reflect.Value, val interface{}) error
- func TypeOf(obj interface{}) reflect.Type
- func ValueOf(obj interface{}) (v reflect.Value, err error)
- type Typer
- func (t *Typer) CheckExistsField(name string) (int, bool)
- func (t *Typer) Field(i int) reflect.StructField
- func (t *Typer) ForEach(...) (err error)
- func (t *Typer) ForEachMethod(fn func(index int, method reflect.Method, value reflect.Value) error) error
- func (t *Typer) ForEachVal(...) (err error)
- func (t *Typer) GetFieldTypName(name string) string
- func (t *Typer) Name() string
- func (t *Typer) TypeOf() reflect.Type
- func (t *Typer) ValueOf() reflect.Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSkipStruct Field is returned when a struct field is skipped. ErrSkipStruct = errors.New("skip struct") )
View Source
var (
Tag = "z"
)
Functions ¶
func CheckExistsField ¶
CheckExistsField check field is exists by name
func GetFieldTypName ¶
func GetStructTag ¶
func GetStructTag(field reflect.StructField) (tagValue string)
func IsLabelType ¶
func MapToStruct ¶
func MapTypStruct ¶
func SetStructFidld ¶
Types ¶
type Typer ¶
type Typer struct {
// contains filtered or unexported fields
}
func (*Typer) ForEach ¶
func (t *Typer) ForEach(fn func(parent []string, index int, tag string, field reflect.StructField) error) (err error)
ForEach For Each Struct field
func (*Typer) ForEachMethod ¶
func (*Typer) ForEachVal ¶
func (t *Typer) ForEachVal(fn func(parent []string, index int, tag string, field reflect.StructField, val reflect.Value) error) (err error)
ForEachVal For Each Struct field
func (*Typer) GetFieldTypName ¶
Click to show internal directories.
Click to hide internal directories.