Documentation ¶
Overview ¶
Package common CEF Util
Index ¶
- Constants
- Variables
- func ArrayIndexOf(array interface{}, a interface{}) int
- func BoolToByte(b bool) byte
- func ByteToBool(b byte) bool
- func ByteToInt8(b byte) int8
- func ByteToUInt8(b byte) uint8
- func BytesToFloat32(bytes []byte) float32
- func BytesToFloat64(bytes []byte) float64
- func BytesToInt(b []byte) int
- func BytesToInt16(b []byte) int16
- func BytesToInt32(b []byte) int32
- func BytesToInt64(b []byte) int64
- func BytesToString(data []byte) string
- func BytesToUInt(b []byte) uint
- func BytesToUInt16(b []byte) uint16
- func BytesToUInt32(b []byte) uint32
- func BytesToUInt64(b []byte) uint64
- func Concat(str ...string) string
- func DDateTimeToGoDateTime(dateTime float64) time.Time
- func Dir() (string, error)
- func Expand(path string) (string, error)
- func Float32ToBytes(float float32) []byte
- func Float64ToBytes(float float64) []byte
- func FrameworkDir() string
- func GetInstancePtr(ptr uintptr) unsafe.Pointer
- func GetParamOf(index int, ptr uintptr) uintptr
- func GetParamPtr(ptr uintptr, offset int) unsafe.Pointer
- func GoDateTimeToDDateTime(dateTime time.Time) float64
- func GoStr(ptr uintptr) string
- func GoroutineID() (id uint64)
- func Int16ToBytes(i int16) []byte
- func Int32ToBytes(i int32) []byte
- func Int64ToBytes(i int64) []byte
- func Int8ToBytes(i int8) []byte
- func IntToBytes(i int) []byte
- func InterfaceToString(value interface{}) string
- func IsDarwin() bool
- func IsLinux() bool
- func IsPlan9() bool
- func IsWindows() bool
- func Reset()
- func SetFrameworkEnv(value string)
- func StrToFloat32(value string) float32
- func StrToFloat64(value string) float64
- func StrToInt32(value string) int32
- func StrToInt64(value string) int64
- func StringToBytes(s string, isDStr ...bool) []byte
- func UInt16ToBytes(i uint16) []byte
- func UInt32ToBytes(i uint32) []byte
- func UInt64ToBytes(i uint64) []byte
- func UInt8ToBytes(i uint8) []byte
- func UIntToBytes(i uint) []byte
- func ValueToBool(v interface{}) bool
- func ValueToFloat64(v interface{}) float64
- func ValueToInt(v interface{}) int
Constants ¶
const ( IntSize = strconv.IntSize //bit IntSize32 = 32 // )
Variables ¶
var DisableCache bool
DisableCache will disable caching of the home directory. Caching is enabled by default.
Functions ¶
func ArrayIndexOf ¶
func ArrayIndexOf(array interface{}, a interface{}) int
ArrayIndexOf 返回a在array数组的下标, a必须和array元素的类型相同
func BoolToByte ¶
func ByteToBool ¶
func ByteToInt8 ¶
func ByteToUInt8 ¶
func BytesToInt ¶
func BytesToInt16 ¶
func BytesToInt32 ¶
func BytesToInt64 ¶
func BytesToString ¶
func BytesToUInt ¶
func BytesToUInt16 ¶
func BytesToUInt32 ¶
func BytesToUInt64 ¶
func DDateTimeToGoDateTime ¶
func Dir ¶
Dir returns the home directory for the executing user.
This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.
func Expand ¶
Expand expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.
func FrameworkDir ¶ added in v2.3.0
func FrameworkDir() string
FrameworkDir
返回CEF框架目录, 以当前执行文件所在目录开始查找 如果当前执行文件目录未找到,再从ENERGY_HOME环境变量查找 Darwin 平台除外
func GetParamPtr ¶
GetParamPtr 根据指定指针位置开始 偏移获取指针
func GoDateTimeToDDateTime ¶
func Int16ToBytes ¶
func Int32ToBytes ¶
func Int64ToBytes ¶
func Int8ToBytes ¶
func IntToBytes ¶
func InterfaceToString ¶
func InterfaceToString(value interface{}) string
InterfaceToString 接口转 string
func Reset ¶
func Reset()
Reset clears the cache, forcing the next call to Dir to re-detect the home directory. This generally never has to be called, but can be useful in tests if you're modifying the home directory via the HOME env var or something.
func SetFrameworkEnv ¶ added in v2.3.0
func SetFrameworkEnv(value string)
func StrToFloat32 ¶
func StrToFloat64 ¶
func StrToInt32 ¶
func StrToInt64 ¶
func StringToBytes ¶
String转换Bytes数组,isDStr转换DString 默认GoString
func UInt16ToBytes ¶
func UInt32ToBytes ¶
func UInt64ToBytes ¶
func UInt8ToBytes ¶
func UIntToBytes ¶
func ValueToFloat64 ¶
func ValueToFloat64(v interface{}) float64
func ValueToInt ¶
func ValueToInt(v interface{}) int
Types ¶
This section is empty.