Documentation
¶
Index ¶
- func AnyToMap(value interface{}, opts ...StructOption) (map[string]any, error)
- func GetBool(tmp interface{}) bool
- func GetFloat64(tmp interface{}) (float64, error)
- func GetInt(tmp interface{}) (int, error)
- func GetInt64(tmp interface{}) (int64, error)
- func GetRealReflectVal(f *field, v reflect.Value) (subv reflect.Value)
- func GetString(v interface{}) string
- func GetUint64(tmp interface{}) (uint64, error)
- type MapScanner
- type StructFields
- type StructOption
- type StructScanner
- type TagOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToMap ¶
func AnyToMap(value interface{}, opts ...StructOption) (map[string]any, error)
将value 转换为map
func GetFloat64 ¶
func GetRealReflectVal ¶ added in v0.2.2
Types ¶
type MapScanner ¶
type StructFields ¶
type StructFields struct { List []field ExactName map[string]*field // contains filtered or unexported fields }
func CachedTypeFields ¶
func CachedTypeFields(t reflect.Type) *StructFields
type StructOption ¶
type StructOption func(*structOptions)
func WithMaxDepth ¶
func WithMaxDepth(maxDepth int) StructOption
type StructScanner ¶
type TagOptions ¶ added in v0.3.0
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 (TagOptions) Contains ¶ added in v0.3.0
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.
func (TagOptions) GetArgsInfo ¶ added in v0.3.0
func (o TagOptions) GetArgsInfo(opt string) (args []string, ok bool)
Click to show internal directories.
Click to hide internal directories.