xreflect

package
v0.1.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

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 GetBool

func GetBool(tmp interface{}) bool

func GetFloat64

func GetFloat64(tmp interface{}) (float64, error)

func GetInt

func GetInt(tmp interface{}) (int, error)

func GetInt64

func GetInt64(tmp interface{}) (int64, error)

func GetString

func GetString(v interface{}) string

func GetUint64

func GetUint64(tmp interface{}) (uint64, error)

Types

type FieldNewValuePool

type FieldNewValuePool interface {
	Get() interface{}
	Put(interface{})
}

type MapScanner

type MapScanner interface {
	MapScan(val any) error
}

type StructFields

type StructFields struct {
	List      []field
	ExactName map[string]*field
}

func CachedTypeFields

func CachedTypeFields(t reflect.Type) *StructFields

type StructOption

type StructOption func(*structOptions)

func WithMaxDepth

func WithMaxDepth(maxDepth int) StructOption

type StructScanner

type StructScanner interface {
	StructScan(vals ...any) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL