tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionMark  = "Version"
	TagHashMark  = "hash"
	TagRangeMark = "range"
)

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy(source interface{}, target interface{}) error

func GenerateKeyMapFromStructSlice

func GenerateKeyMapFromStructSlice(sl interface{}) map[interface{}]uint8

GenerateKeyMapFromStructSlice sl为StorageModel数组 []Storage

func GetFieldInfo added in v0.1.0

func GetFieldInfo(value interface{}) map[string]interface{}

GetFieldInfo 获取结构体中除了特定标签外的所有字段的名称和值

func GetFieldValueByName

func GetFieldValueByName(value interface{}, name string) interface{}

func GetFieldValueByRealName

func GetFieldValueByRealName(value interface{}, name string) interface{}

func GetHashAndRangeKey

func GetHashAndRangeKey(value interface{}, useTag bool) (hashKey string, rangeKey string)

func GetHashAndRangeValue added in v0.1.0

func GetHashAndRangeValue(value interface{}) (hashValue interface{}, rangeValue interface{})

func GetHashName

func GetHashName(model interface{}) string

GetHashName 获取主键在结构体中的名字

func GetInterfacePtr

func GetInterfacePtr(value interface{}) interface{}

func GetPointer added in v0.1.1

func GetPointer(value interface{}) interface{}

func GetSliceFromInterfacePtr

func GetSliceFromInterfacePtr(value interface{}) []interface{}

func GetSliceStructName

func GetSliceStructName(value interface{}) string

func GetStructName

func GetStructName(value interface{}) string

func GetStructOnlyName

func GetStructOnlyName(value interface{}) string

func GetStructVersionFromOriginData

func GetStructVersionFromOriginData(value interface{}) (uint64, error)

GetStructVersionFromOriginData 获取版本

func GetVersionFieldPath added in v0.1.4

func GetVersionFieldPath(value interface{}) string

func LowerAllChar added in v0.1.0

func LowerAllChar(s string) string

func TrySetStructDefaultValue added in v0.1.1

func TrySetStructDefaultValue(value interface{}) error

func TrySetStructVersion

func TrySetStructVersion(value interface{}) (uint64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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