Documentation
¶
Index ¶
- Constants
- Variables
- func AnySetWithRelaxedNumbers(to, from reflect.Value)
- func CopyAny(v any) any
- func DeepCopy(destPtr, source any) error
- func FlattenAll(f reflect.StructField) bool
- func FlattenIfAnonymous(f reflect.StructField) bool
- func ForEachField(istruct any, flatten func(f reflect.StructField) bool, ...)
- func GetTagAsMap(stag string) map[string][]string
- func GetTagValuesForKey(stag reflect.StructTag, key string) (vals []string, ignore bool)
- func GetZTags(tagMap map[string][]string, tagName string) (keyVals []zstr.KeyValue, skip bool)
- func HashAnyToInt64(a interface{}, add string) int64
- func IsRealSlice(val reflect.Value) bool
- func NewOfAny(a any) any
- func SetStringToAny(toPtr any, from string) error
- func StructFieldNames(istruct any, flatten func(f reflect.StructField) bool) []string
- func Swap[A any](a, b *A)
- type FieldInfo
- type Item
- type Options
- type TypeKind
Constants ¶
View Source
const ( KindUndef TypeKind = "undef" KindString = "string" KindInt = "int" KindFloat = "float" KindBool = "bool" KindStruct = "struct" KindTime = "time" KindByte = "byte" KindMap = "map" KindFunc = "function" KindSlice = "slice" KindArray = "slice" KindInterface = "interface" KindPointer = "pointer" )
Variables ¶
View Source
var (
TimeType = reflect.TypeOf(time.Time{})
)
Functions ¶
func AnySetWithRelaxedNumbers ¶
AnySetWithRelaxedNumbers sets int, float values from->to
func CopyAny ¶
CopyVal makes a copy of rval. If rval is a pointer, it makes a copy of element and returns a pointer
func FlattenAll ¶
func FlattenAll(f reflect.StructField) bool
func FlattenIfAnonymous ¶
func FlattenIfAnonymous(f reflect.StructField) bool
func ForEachField ¶
func GetTagAsMap ¶
func GetTagValuesForKey ¶
func HashAnyToInt64 ¶
func IsRealSlice ¶
func NewOfAny ¶
NewOfAny returns a new'ed item of that type. If a is a pointer, its element is used.
func SetStringToAny ¶
func StructFieldNames ¶
func StructFieldNames(istruct any, flatten func(f reflect.StructField) bool) []string
Types ¶
type FieldInfo ¶
type FieldInfo struct { FieldIndex int // this is the index of the field _used_ field, not adding skipped, and increasing in anon ReflectValue reflect.Value StructField reflect.StructField }
func FieldForIndex ¶
func FieldForName ¶
type Item ¶
Click to show internal directories.
Click to hide internal directories.