util

package
v1.3.171 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Key       = "key"
	Auto      = "auto"
	UUID      = "uuid"
	SnowFlake = "snowflake"
	DateTime  = "dateTime"
)

Variables

This section is empty.

Functions

func GetBool

func GetBool(val any) (ret model.RawVal, err *cd.Result)

func GetCurrentDateTime

func GetCurrentDateTime() (ret time.Time)

func GetCurrentDateTimeStr

func GetCurrentDateTimeStr() (ret string)

func GetDateTime added in v1.3.147

func GetDateTime(val any) (ret model.RawVal, err *cd.Result)

func GetFloat32

func GetFloat32(val any) (ret model.RawVal, err *cd.Result)

func GetFloat64

func GetFloat64(val any) (ret model.RawVal, err *cd.Result)

func GetInt

func GetInt(val any) (ret model.RawVal, err *cd.Result)

func GetInt16

func GetInt16(val any) (ret model.RawVal, err *cd.Result)

func GetInt32

func GetInt32(val any) (ret model.RawVal, err *cd.Result)

func GetInt64

func GetInt64(val any) (ret model.RawVal, err *cd.Result)

func GetInt8

func GetInt8(val any) (ret model.RawVal, err *cd.Result)

func GetNewSnowFlakeID

func GetNewSnowFlakeID() (ret int64)

func GetNewUUID

func GetNewUUID() (ret string)

func GetRawBool added in v1.3.147

func GetRawBool(rVal reflect.Value) (ret bool, err *cd.Result)

func GetRawDateTime added in v1.3.147

func GetRawDateTime(rVal reflect.Value) (ret time.Time, err *cd.Result)

func GetRawFloat32 added in v1.3.147

func GetRawFloat32(rVal reflect.Value) (ret float32, err *cd.Result)

func GetRawFloat64 added in v1.3.147

func GetRawFloat64(rVal reflect.Value) (ret float64, err *cd.Result)

func GetRawInt added in v1.3.147

func GetRawInt(rVal reflect.Value) (ret int, err *cd.Result)

func GetRawInt16 added in v1.3.147

func GetRawInt16(rVal reflect.Value) (ret int16, err *cd.Result)

func GetRawInt32 added in v1.3.147

func GetRawInt32(rVal reflect.Value) (ret int32, err *cd.Result)

func GetRawInt64 added in v1.3.147

func GetRawInt64(rVal reflect.Value) (ret int64, err *cd.Result)

func GetRawInt8 added in v1.3.147

func GetRawInt8(rVal reflect.Value) (ret int8, err *cd.Result)

func GetRawString added in v1.3.147

func GetRawString(rVal reflect.Value) (ret string, err *cd.Result)

func GetRawUint added in v1.3.147

func GetRawUint(rVal reflect.Value) (ret uint, err *cd.Result)

func GetRawUint16 added in v1.3.147

func GetRawUint16(rVal reflect.Value) (ret uint16, err *cd.Result)

func GetRawUint32 added in v1.3.147

func GetRawUint32(rVal reflect.Value) (ret uint32, err *cd.Result)

func GetRawUint64 added in v1.3.147

func GetRawUint64(rVal reflect.Value) (ret uint64, err *cd.Result)

func GetRawUint8 added in v1.3.147

func GetRawUint8(rVal reflect.Value) (ret uint8, err *cd.Result)

func GetString

func GetString(val any) (ret model.RawVal, err *cd.Result)

func GetTypeEnum

func GetTypeEnum(val reflect.Type) (ret model.TypeDeclare, err *cd.Result)

func GetUint

func GetUint(val any) (ret model.RawVal, err *cd.Result)

func GetUint16

func GetUint16(val any) (ret model.RawVal, err *cd.Result)

func GetUint32

func GetUint32(val any) (ret model.RawVal, err *cd.Result)

func GetUint64

func GetUint64(val any) (ret model.RawVal, err *cd.Result)

func GetUint8

func GetUint8(val any) (ret model.RawVal, err *cd.Result)

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

func IsMap(tType reflect.Type) bool

func IsNil

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

IsNil check value if nil

func IsNumber

func IsNumber(tType reflect.Type) bool

func IsPtr

func IsPtr(tType reflect.Type) bool

func IsSameValue added in v1.3.131

func IsSameValue(firstVal, secondVal any) (ret bool)

func IsSlice

func IsSlice(tType reflect.Type) bool

func IsString

func IsString(tType reflect.Type) bool

func IsStruct

func IsStruct(tType reflect.Type) bool

func IsUInteger

func IsUInteger(tType reflect.Type) bool

func IsZero

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

Types

type Codec added in v1.3.147

type Codec interface {
	Encode(vVal model.Value, vType model.Type) (ret model.RawVal, err *cd.Result)
	Decode(val model.RawVal, vType model.Type) (ret model.Value, err *cd.Result)
}

func New added in v1.3.147

func New(elemDependValue ElemDependValueFunc) Codec

type ElemDependValueFunc added in v1.3.147

type ElemDependValueFunc func(val model.RawVal) ([]model.Value, *cd.Result)

Jump to

Keyboard shortcuts

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