util

package
v1.3.27 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeBooleanValue bool
	TypeBooleanValue = iota + 100
	// TypeBitValue int8
	TypeBitValue
	// TypeSmallIntegerValue int16
	TypeSmallIntegerValue
	// TypeInteger32Value int32
	TypeInteger32Value
	// TypeIntegerValue int
	TypeIntegerValue
	// TypeBigIntegerValue int64
	TypeBigIntegerValue
	// TypePositiveBitValue uint8
	TypePositiveBitValue
	// TypePositiveSmallIntegerValue uint16
	TypePositiveSmallIntegerValue
	// TypePositiveInteger32Value uint32
	TypePositiveInteger32Value
	// TypePositiveIntegerValue uint
	TypePositiveIntegerValue
	// TypePositiveBigIntegerValue uint64
	TypePositiveBigIntegerValue
	// TypeFloatValue float32
	TypeFloatValue
	// TypeDoubleValue float64
	TypeDoubleValue
	// TypeStringValue string
	TypeStringValue
	// TypeDateTimeValue time.Time
	TypeDateTimeValue
	// TypeStructValue struct
	TypeStructValue
	// TypeSliceValue slice
	TypeSliceValue
	// TypeMapValue map
	TypeMapValue = 500
)

Define the Type enum

Variables

This section is empty.

Functions

func AddSlashes

func AddSlashes(str string) string

AddSlashes() 函数返回在预定义字符之前添加反斜杠的字符串。 预定义字符是: 单引号(') 双引号(") 反斜杠(\)

func GetTypeEnum

func GetTypeEnum(val reflect.Type) (ret int, err error)

GetTypeEnum return field type as type constant from reflect.Value

func IsBasicType

func IsBasicType(typeValue int) bool

func IsBool

func IsBool(tType reflect.Type) bool

func IsDateTime

func IsDateTime(tType reflect.Type) bool

func IsFloat

func IsFloat(tType reflect.Type) bool

func IsInteger

func IsInteger(tType reflect.Type) bool

func IsMap added in v1.2.0

func IsMap(tType reflect.Type) bool

func IsMapType added in v1.2.0

func IsMapType(typeVal int) bool

func IsNil

func IsNil(val reflect.Value) (ret bool)

IsNil check value if nil

func IsSameVal

func IsSameVal(firstVal, secondVal reflect.Value) (ret bool, err error)

IsSameVal is same value

func IsSlice

func IsSlice(tType reflect.Type) bool

func IsSliceType

func IsSliceType(typeValue int) bool

func IsString

func IsString(tType reflect.Type) bool

func IsStruct

func IsStruct(tType reflect.Type) bool

func IsStructType

func IsStructType(typeValue int) bool

func IsUInteger

func IsUInteger(tType reflect.Type) bool

func StripSlashes

func StripSlashes(str string) string

StripSlashes() 函数删除由 AddSlashes() 函数添加的反斜杠。

Types

This section is empty.

Jump to

Keyboard shortcuts

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