common

package
v1.109.1184 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntSize   = strconv.IntSize //bit
	IntSize32 = 32              //

)
View Source
const (
	PT_MAIN     PRCESS_TYPE = ""
	PT_GPU                  = "gpu-process"
	PT_UTILITY              = "utility"
	PT_RENDERER             = "renderer"
	PT_DEVTOOLS             = "devtools"
)

Variables

View Source
var Args = argsParse()

Functions

func ArrayIndexOf

func ArrayIndexOf[T any](array []T, a interface{}) int

func BoolToByte

func BoolToByte(b bool) byte

func ByteToBool

func ByteToBool(b byte) bool

func ByteToInt8

func ByteToInt8(b byte) int8

func BytesToFloat32

func BytesToFloat32(bytes []byte) float32

BytesToFloat32 byte转Float64

func BytesToFloat64

func BytesToFloat64(bytes []byte) float64

BytesToFloat64 byte转Float64

func BytesToInt

func BytesToInt(b []byte) int

func BytesToInt16

func BytesToInt16(b []byte) int16

func BytesToInt32

func BytesToInt32(b []byte) int32

func BytesToInt64

func BytesToInt64(b []byte) int64

func BytesToString

func BytesToString(data []byte) string

func CopyBytePtr

func CopyBytePtr(bytePtr uintptr, low, high int) []byte

func DDateTimeToGoDateTime

func DDateTimeToGoDateTime(dateTime float64) time.Time

func Float32ToBytes

func Float32ToBytes(float float32) []byte

Float32ToBytes Float64转byte

func Float64ToBytes

func Float64ToBytes(float float64) []byte

Float64ToBytes Float64转byte

func FuncParamGoTypeStr

func FuncParamGoTypeStr(jsValue GO_VALUE_TYPE) string

func FuncParamJsTypeStr

func FuncParamJsTypeStr(jsValue V8_JS_VALUE_TYPE) string

func GOValueAssertType

func GOValueAssertType(v interface{}) GO_VALUE_TYPE

func GOValueReflectType

func GOValueReflectType(v interface{}) GO_VALUE_TYPE

func GOValueType

func GOValueType(v string) GO_VALUE_TYPE

func GetInstancePtr

func GetInstancePtr(ptr uintptr) unsafe.Pointer

获取指针的指针的地址

func GetParamOf

func GetParamOf(index int, ptr uintptr) uintptr

获取参数指针

func GetParamPtr

func GetParamPtr(ptr uintptr, offset int) unsafe.Pointer

根据指定指针位置开始 偏移获取指针

func GoDateTimeToDDateTime

func GoDateTimeToDDateTime(dateTime time.Time) float64

func GoroutineID added in v1.106.11

func GoroutineID() (id uint64)

GoroutineID 获取当前携程ID

func Int16ToBytes

func Int16ToBytes(i int16) []byte

func Int32ToBytes

func Int32ToBytes(i int32) []byte

func Int64ToBytes

func Int64ToBytes(i int64) []byte

func Int8ToBytes

func Int8ToBytes(i int8) []byte

func IntToBytes

func IntToBytes(i int) []byte

func InterfaceToString

func InterfaceToString(value interface{}) string

func IsDarwin

func IsDarwin() bool

func IsLinux

func IsLinux() bool

func IsPlan9 added in v1.106.11

func IsPlan9() bool

func IsWindows

func IsWindows() bool

func JSValueAssertType

func JSValueAssertType(v interface{}) V8_JS_VALUE_TYPE

func JSValueType

func JSValueType(v string) V8_JS_VALUE_TYPE

func NumberPtrToFloat

func NumberPtrToFloat(value unsafe.Pointer, gov GO_VALUE_TYPE) interface{}

func NumberUintPtrToInt

func NumberUintPtrToInt(value uintptr, gov GO_VALUE_TYPE) interface{}

func ParamType

func ParamType(t string) (V8_JS_VALUE_TYPE, GO_VALUE_TYPE)

func StrToFloat32

func StrToFloat32(value string) float32

func StrToFloat64

func StrToFloat64(value string) float64

func StrToInt32

func StrToInt32(value string) int32

func StrToInt64

func StrToInt64(value string) int64

func StringToBytes

func StringToBytes(s string, isDStr ...bool) []byte

String转换Bytes数组,isDStr转换DString 默认GoString

func ValueToBool

func ValueToBool(v interface{}) (bool, error)

func ValueToBytes

func ValueToBytes(v interface{}) []byte

func ValueToFloat32

func ValueToFloat32(v interface{}) (float32, error)

func ValueToFloat64

func ValueToFloat64(v interface{}) (float64, error)

func ValueToInt32

func ValueToInt32(v interface{}) (int32, error)

func ValueToInt64

func ValueToInt64(v interface{}) (int64, error)

func ValueToString

func ValueToString(v interface{}) (string, error)

Types

type CliID

type CliID struct {
	IPCIDGen
}

type IPCIDGen

type IPCIDGen struct {
	// contains filtered or unexported fields
}

IPC ID生成

func (*IPCIDGen) New

func (m *IPCIDGen) New() int32

type MsgID

type MsgID struct {
	IPCIDGen
}

消息ID生成

type PRCESS_TYPE

type PRCESS_TYPE string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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