toolkit

package
v0.0.0-...-806eab8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bean2Map

func Bean2Map(structVal any, forceConvFields ...string) map[string]any

func Bean2Map4CustomStrategy

func Bean2Map4CustomStrategy(structVal any, convertName func(fileName string) string,
	forceConvFields ...string) map[string]any

func Bean2MapHump

func Bean2MapHump(structVal any, forceConvFields ...string) map[string]any

func Bean2MapSnake

func Bean2MapSnake(structVal any, forceConvFields ...string) map[string]any

func BeanFieldsForeach

func BeanFieldsForeach(structVal any, consumer func(fieldName string, rvField reflect.Value))

func CopyProperties

func CopyProperties(source any, target any, ignores ...string)

func CopyPropertiesByJson

func CopyPropertiesByJson(source any, target any)

func CopyStruct

func CopyStruct[Struct any](source any) *Struct

func GetAllFieldNames4CustomStrategy

func GetAllFieldNames4CustomStrategy(structVal any, convertName func(fileName string) string,
	forceExcludeFields ...string) []string

func GetFieldNames4IncludeTypeAndCustomStrategy

func GetFieldNames4IncludeTypeAndCustomStrategy(structVal any, includeType includeType,
	convertName func(fileName string) string, forceExcludeFields ...string) []string

func GetNotZeroFieldNames4CustomStrategy

func GetNotZeroFieldNames4CustomStrategy(structVal any, convertName func(fileName string) string,
	forceExcludeFields ...string) []string

func GetZeroFieldNames

func GetZeroFieldNames(structVal any, ignores ...string) []string

func GetZeroFieldNames4CustomStrategy

func GetZeroFieldNames4CustomStrategy(structVal any, convertName func(fileName string) string,
	forceExcludeFields ...string) []string

func GetZeroFieldNamesHump

func GetZeroFieldNamesHump(structVal any, ignores ...string) []string

func GetZeroFieldNamesSnake

func GetZeroFieldNamesSnake(structVal any, ignores ...string) []string

func IsNil

func IsNil(a any) bool

func Map2Bean

func Map2Bean[T comparable](mapVal map[string]any) *T

func NotExistTag

func NotExistTag(rtStruct reflect.Type, tag string) bool

func ToJson

func ToJson(obj any) string

ToJson 该方法结构体可以不写json tag,内部会自动帮我们加

func ToJson2

func ToJson2(obj any, omitempty bool) string

func ToJson3

func ToJson3(obj any) string

func ToObj

func ToObj(jsonStr string, obj any)

func ToObj4Bytes

func ToObj4Bytes(bytes []byte, obj any)

func ToStruct

func ToStruct[T comparable](jsonStr string) *T

func ToStruct4Bytes

func ToStruct4Bytes[T comparable](bytes []byte) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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