Documentation ¶
Index ¶
- Constants
- func DumpTypeInfoBFS(t reflect.Type) string
- func DumpTypeInfoDFS(t reflect.Type) string
- func DumpValueInfoBFS(v reflect.Value) string
- func DumpValueInfoDFS(v reflect.Value) string
- func FollowTypePointer(v reflect.Type) reflect.Type
- func FollowValuePointer(v reflect.Value) reflect.Value
- func IsEmptyValue(v reflect.Value) bool
- func IsFieldExported(sf reflect.StructField) bool
- func IsNilObject(obtained interface{}) (result bool)
- func IsNilType(v reflect.Type) (result bool)
- func IsNilValue(v reflect.Value) (result bool)
- func IsValidTagName(tagName string) bool
- func IsZeroValue(v reflect.Value) bool
- func TypeByStructFieldIndex(t reflect.Type, index []int) reflect.Type
- func ValueByStructFieldIndex(v reflect.Value, index []int) reflect.Value
- func Walk(t reflect.Type, visitedOnce bool, ...)
- func WalkTypeBFS(typ reflect.Type, handler FieldTypeInfoHandler)
- func WalkTypeDFS(typ reflect.Type, handler FieldTypeInfoHandler)
- func WalkValueBFS(val reflect.Value, handler FieldValueInfoHandler)
- func WalkValueDFS(val reflect.Value, handler FieldValueInfoHandler)
- type FieldTypeInfo
- type FieldTypeInfoHandler
- type FieldTypeInfoHandlerFunc
- type FieldValueInfo
- type FieldValueInfoHandler
- type FieldValueInfoHandlerFunc
- type TagOptions
Constants ¶
View Source
const PtrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const, sizeof *void
Variables ¶
This section is empty.
Functions ¶
func DumpTypeInfoBFS ¶
func DumpTypeInfoDFS ¶
func DumpValueInfoBFS ¶
func DumpValueInfoDFS ¶
func IsEmptyValue ¶
func IsFieldExported ¶
func IsFieldExported(sf reflect.StructField) bool
func IsNilObject ¶
func IsNilObject(obtained interface{}) (result bool)
func IsNilValue ¶
func IsValidTagName ¶
func TypeByStructFieldIndex ¶
t[i][j][...], t[i] is t's ith field, t[i][j] is t[i]'s jth field
func ValueByStructFieldIndex ¶
v[i][j][...], v[i] is v's ith field, v[i][j] is v[i]'s jth field
func Walk ¶
func Walk(t reflect.Type, visitedOnce bool, do func(s reflect.Type, sf reflect.StructField) (stop bool))
walks down v
func WalkTypeBFS ¶
func WalkTypeBFS(typ reflect.Type, handler FieldTypeInfoHandler)
Breadth First Search
func WalkTypeDFS ¶
func WalkTypeDFS(typ reflect.Type, handler FieldTypeInfoHandler)
Wid First Search
func WalkValueBFS ¶
func WalkValueBFS(val reflect.Value, handler FieldValueInfoHandler)
func WalkValueDFS ¶
func WalkValueDFS(val reflect.Value, handler FieldValueInfoHandler)
Types ¶
type FieldTypeInfo ¶
type FieldTypeInfo struct {
// contains filtered or unexported fields
}
A field represents a single field found in a struct.
func (FieldTypeInfo) Depth ¶
func (info FieldTypeInfo) Depth() int
func (FieldTypeInfo) Index ¶
func (info FieldTypeInfo) Index() []int
func (FieldTypeInfo) MiddleNodes ¶
func (info FieldTypeInfo) MiddleNodes() []interface{}
func (FieldTypeInfo) String ¶
func (info FieldTypeInfo) String() string
func (FieldTypeInfo) StructField ¶
func (info FieldTypeInfo) StructField() (reflect.StructField, bool)
type FieldTypeInfoHandler ¶
type FieldTypeInfoHandler interface {
Handler(info FieldTypeInfo) (goon bool)
}
type FieldTypeInfoHandlerFunc ¶
type FieldTypeInfoHandlerFunc func(info FieldTypeInfo) (goon bool)
func (FieldTypeInfoHandlerFunc) Handler ¶
func (f FieldTypeInfoHandlerFunc) Handler(info FieldTypeInfo) (goon bool)
type FieldValueInfo ¶
type FieldValueInfo struct {
// contains filtered or unexported fields
}
A field represents a single field found in a struct.
func (FieldValueInfo) Depth ¶
func (info FieldValueInfo) Depth() int
func (FieldValueInfo) Index ¶
func (info FieldValueInfo) Index() []int
func (FieldValueInfo) MiddleNodes ¶
func (info FieldValueInfo) MiddleNodes() []interface{}
func (*FieldValueInfo) String ¶
func (info *FieldValueInfo) String() string
func (FieldValueInfo) StructField ¶
func (info FieldValueInfo) StructField() (reflect.StructField, bool)
func (FieldValueInfo) Value ¶
func (info FieldValueInfo) Value() reflect.Value
type FieldValueInfoHandler ¶
type FieldValueInfoHandler interface {
Handler(info FieldValueInfo) (goon bool)
}
type FieldValueInfoHandlerFunc ¶
type FieldValueInfoHandlerFunc func(info FieldValueInfo) (goon bool)
func (FieldValueInfoHandlerFunc) Handler ¶
func (f FieldValueInfoHandlerFunc) Handler(info FieldValueInfo) (goon bool)
type TagOptions ¶
type TagOptions string
TagOptions is the string following a comma in a struct field's "json" tag, or the empty string. It does not include the leading comma.
func ParseTagOptions ¶
func ParseTagOptions(tag string) (tagName string, opts TagOptions)
ParseTagOptions splits a struct field's json tag into its name and comma-separated options.
func (TagOptions) Contains ¶
func (o TagOptions) Contains(optionName string) bool
Contains reports whether a comma-separated list of options contains a particular substr flag. substr must be surrounded by a string boundary or commas.
Click to show internal directories.
Click to hide internal directories.