util

package
Version: v0.0.0-...-7cf166a Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// bool
	TypeBooleanField = 1 << iota
	// string
	TypeStringField
	// time.Time
	TypeDateTimeField
	// int8
	TypeBitField
	// int16
	TypeSmallIntegerField
	// int32
	TypeInteger32Field
	// int
	TypeIntegerField
	// int64
	TypeBigIntegerField
	// uint8
	TypePositiveBitField
	// uint16
	TypePositiveSmallIntegerField
	// uint32
	TypePositiveInteger32Field
	// uint
	TypePositiveIntegerField
	// uint64
	TypePositiveBigIntegerField
	// float32
	TypeFloatField
	// float64
	TypeDoubleField
	// struct
	TypeStructField
	// slice
	TypeSliceField
)

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

IsBasicType IsBasicType

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 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

IsSliceType IsSliceType

func IsString

func IsString(tType reflect.Type) bool

func IsStruct

func IsStruct(tType reflect.Type) bool

func IsStructType

func IsStructType(typeValue int) bool

IsStructType IsStructType

func IsUInteger

func IsUInteger(tType reflect.Type) bool

func StripSlashes

func StripSlashes(str string) string

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

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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