Documentation ¶
Index ¶
- Constants
- func AddSafePool(t interface{}, f func() interface{})
- func AddUnsafePool(t interface{}, f func() interface{})
- func Ceil(d float32, bit int32) float32
- func CeilInt32(ceil, v int32) (r, o int32)
- func ClampFloat(min, max, v float32) float32
- func ClampInt32(min, max, v int32) int32
- func CopyBytes(src []byte) []byte
- func ErrorChanClosed() error
- func ErrorSubmitGoroutine() error
- func ErrorTimeout() error
- func Floor(d float32, bit int32) float32
- func FloorInt32(floor, v int32) (r, o int32)
- func GetMask(vals ...uint64) uint64
- func GetSnowflakeId() int64
- func GetSnowflakeIdStr() string
- func Int64ToStr(id int64) string
- func Int64sToStrSlice(ids ...int64) []string
- func Lock(key string)
- func MaskAddVal(val, mask uint64) uint64
- func MaskDelVal(val, mask uint64) uint64
- func MaxInt32(a, b int32) int32
- func MinInt32(a, b int32) int32
- func NewConcurrentData(m map[string]interface{}) *concurrentData
- func NewData(m map[string]interface{}) *data
- func NewObject(data map[string]interface{}) *object
- func NewPool(f func() interface{}) *sync.Pool
- func NewRingBuffer(cap int) *ringBuffer
- func NewUnsafePool(f func() interface{}) *nosync.Pool
- func NewWeightSelector() *weightSelector
- func NewWorkerManager(workerCap int, complete Action) *workerManager
- func RLock(key string)
- func RUnlock(key string)
- func RandStr(n int) string
- func RecycleBytes(data []byte)
- func RecyclePoolObj(t interface{}, obj interface{})
- func Round(d float32, bit int32) float32
- func SetSnowflakeNodeId(nodeId int64) (err error)
- func SetTrace(tracer string) (err error)
- func SpawnBytes() []byte
- func SpawnBytesWithLen(l int) []byte
- func SpawnPoolObj(t interface{}) interface{}
- func StartTickWorker(complete Action, duration time.Duration, tick ActionInt64) *worker
- func StartWorker(complete Action) *worker
- func StrToInt64(id string) int64
- func StrToUint16(id string) uint16
- func StrToUint64(id string) uint64
- func TestMask(val, mask uint64) bool
- func TestMaskVals(val uint64, vals ...uint64) bool
- func TraceDebug(tid int64, msg string, fields ...zap.Field)
- func TraceError(tid int64, msg string, error error, fields ...zap.Field)
- func TraceInfo(tid int64, msg string, fields ...zap.Field)
- func TraceSign(parent int64, sign string, fields ...zap.Field) int64
- func TraceWarn(tid int64, msg string, fields ...zap.Field)
- func Uint16ToStr(id uint16) string
- func Uint64ToStr(id uint64) string
- func Unlock(key string)
- func Vec2Angle(v1 Vec2, v2 Vec2) float32
- func Vec2Distance(v1 Vec2, v2 Vec2) float32
- func Vec2Magnitude(v Vec2) float32
- func Vec2TestCircular(point, origin Vec2, radius float32) bool
- func Vec2TestRay(point, origin, normal Vec2, radius, length float32) bool
- func Vec2TestRect(point, origin, normal Vec2, width, length float32) bool
- func Vec2TestSector(point, origin, normal Vec2, radius, angle float32) bool
- func Vec3Angle(v1 Vec3, v2 Vec3) float32
- func Vec3Distance(v1 Vec3, v2 Vec3) float32
- func Vec3Magnitude(v Vec3) float32
- func Vec3TestCentrum(point, origin, normal Vec3, radius, angle float32) bool
- func Vec3TestCylinder(point, origin, normal Vec3, radius, length float32) bool
- func Vec3TestSphere(point, origin Vec3, radius float32) bool
- func Wait(action func(ch WaitCh))
- func WaitOsExit(beforeExit func())
- func WaitRes(action func(chan<- interface{})) (interface{}, error)
- func WaitResAsync(onComplete ActionObjErr) chan<- interface{}
- func WaitTrue(action func()) chan<- bool
- type Action
- type ActionBytes
- type ActionError
- type ActionInt64
- type ActionObj
- type ActionObjErr
- type ActionStr
- type BytesBuffer
- func (b *BytesBuffer) Available() uint32
- func (b *BytesBuffer) Bytes() []byte
- func (b *BytesBuffer) Clear()
- func (b *BytesBuffer) Copy() []byte
- func (b *BytesBuffer) Length() uint32
- func (b *BytesBuffer) Mark()
- func (b *BytesBuffer) Pos() uint32
- func (b *BytesBuffer) RAll() (v []byte)
- func (b *BytesBuffer) RBool() (v bool, err error)
- func (b *BytesBuffer) RBytes(l uint16) (v []byte, err error)
- func (b *BytesBuffer) RBytesWithLen() (v []byte, err error)
- func (b *BytesBuffer) RFloat32() (v float32, err error)
- func (b *BytesBuffer) RFloat64() (v float64, err error)
- func (b *BytesBuffer) RInt32() (v int32, err error)
- func (b *BytesBuffer) RInt64() (v int64, err error)
- func (b *BytesBuffer) RInt8() (v int8, err error)
- func (b *BytesBuffer) RStrMapStr() (m map[string]string, err error)
- func (b *BytesBuffer) RString() (v string, err error)
- func (b *BytesBuffer) RStringNoLen() (v string)
- func (b *BytesBuffer) RUint16() (v uint16, err error)
- func (b *BytesBuffer) RUint32() (v uint32, err error)
- func (b *BytesBuffer) RUint64() (v uint64, err error)
- func (b *BytesBuffer) RUint8() (v uint8, err error)
- func (b *BytesBuffer) RVec2() (v Vec2, err error)
- func (b *BytesBuffer) RVec3() (v Vec3, err error)
- func (b *BytesBuffer) RVec4() (v Vec4, err error)
- func (b *BytesBuffer) RVecInt2() (v VecInt2, err error)
- func (b *BytesBuffer) RVecInt3() (v VecInt3, err error)
- func (b *BytesBuffer) RVecInt4() (v VecInt4, err error)
- func (b *BytesBuffer) ResetMark()
- func (b *BytesBuffer) Rint16() (v int16, err error)
- func (b *BytesBuffer) SetData(bytes []byte)
- func (b *BytesBuffer) SetPos(v uint32) error
- func (b *BytesBuffer) ToHex() string
- func (b *BytesBuffer) WBool(v bool)
- func (b *BytesBuffer) WBytes(v []byte)
- func (b *BytesBuffer) WBytesWithLen(v []byte)
- func (b *BytesBuffer) WFloat32(v float32)
- func (b *BytesBuffer) WFloat64(v float64)
- func (b *BytesBuffer) WInt16(v int16)
- func (b *BytesBuffer) WInt32(v int32)
- func (b *BytesBuffer) WInt64(v int64)
- func (b *BytesBuffer) WInt8(v int8)
- func (b *BytesBuffer) WStrMapStr(m map[string]string)
- func (b *BytesBuffer) WString(v string)
- func (b *BytesBuffer) WStringNoLen(v string)
- func (b *BytesBuffer) WUint16(v uint16)
- func (b *BytesBuffer) WUint32(v uint32)
- func (b *BytesBuffer) WUint64(v uint64)
- func (b *BytesBuffer) WUint8(v uint8)
- func (b *BytesBuffer) WVec2(v Vec4)
- func (b *BytesBuffer) WVec3(v Vec4)
- func (b *BytesBuffer) WVec4(v Vec4)
- func (b *BytesBuffer) WVecInt2(v VecInt2)
- func (b *BytesBuffer) WVecInt3(v VecInt3)
- func (b *BytesBuffer) WVecInt4(v VecInt4)
- type EnableAction
- type FunStr
- type Func
- type IBuffer
- type IData
- type IObject
- type IPool
- type IWeightSelector
- type IWorker
- type IWorkerManager
- type Locker
- type Tuple1
- type Tuple2
- type Tuple3
- type Tuple4
- type Tuple5
- type Tuple6
- type Vec2
- type Vec3
- type Vec4
- type VecInt2
- type VecInt3
- type VecInt4
- type WaitCh
Constants ¶
View Source
const ( Rad2Deg float32 = 57.29578 Deg2Rad float32 = 0.01745329 HalfPi float32 = 1.5707963267948966 )
Variables ¶
This section is empty.
Functions ¶
func AddSafePool ¶
func AddSafePool(t interface{}, f func() interface{})
func AddUnsafePool ¶
func AddUnsafePool(t interface{}, f func() interface{})
func ClampFloat ¶
func ClampInt32 ¶
func ErrorChanClosed ¶
func ErrorChanClosed() error
func ErrorSubmitGoroutine ¶
func ErrorSubmitGoroutine() error
func ErrorTimeout ¶
func ErrorTimeout() error
func FloorInt32 ¶
func GetSnowflakeId ¶
func GetSnowflakeId() int64
func GetSnowflakeIdStr ¶
func GetSnowflakeIdStr() string
func Int64ToStr ¶
func Int64sToStrSlice ¶
func MaskAddVal ¶
func MaskDelVal ¶
func NewConcurrentData ¶
func NewConcurrentData(m map[string]interface{}) *concurrentData
func NewRingBuffer ¶
func NewRingBuffer(cap int) *ringBuffer
func NewUnsafePool ¶
func NewWeightSelector ¶
func NewWeightSelector() *weightSelector
func NewWorkerManager ¶
func RecycleBytes ¶
func RecycleBytes(data []byte)
func RecyclePoolObj ¶
func RecyclePoolObj(t interface{}, obj interface{})
func SetSnowflakeNodeId ¶
func SpawnBytes ¶
func SpawnBytes() []byte
func SpawnBytesWithLen ¶
func SpawnPoolObj ¶
func SpawnPoolObj(t interface{}) interface{}
func StartTickWorker ¶
func StartTickWorker(complete Action, duration time.Duration, tick ActionInt64) *worker
@Description: 启动一个带心跳的处理器, @param executor 处理消息的方法,循环调用自身Push会被阻塞 @param complete 处理器关闭回调 @param duration 心跳间隔 @param tick 心跳处理函数,参数心跳间隔 @return *worker 处理器
func StartWorker ¶
func StartWorker(complete Action) *worker
@Description: 启动一个处理器 @param complete 处理器关闭回调 @return *worker 处理器
func StrToInt64 ¶
func StrToUint16 ¶
func StrToUint64 ¶
func TestMaskVals ¶
func Uint16ToStr ¶
func Uint64ToStr ¶
func Vec2Distance ¶
func Vec2Magnitude ¶
func Vec2TestCircular ¶
func Vec2TestRay ¶
func Vec2TestRect ¶
func Vec2TestSector ¶
func Vec3Distance ¶
func Vec3Magnitude ¶
func Vec3TestCentrum ¶
圆锥
func Vec3TestCylinder ¶
圆柱
func WaitOsExit ¶
func WaitOsExit(beforeExit func())
func WaitResAsync ¶
func WaitResAsync(onComplete ActionObjErr) chan<- interface{}
Types ¶
type ActionBytes ¶
type ActionBytes func(data []byte)
type ActionError ¶
type ActionError func(err error)
type ActionInt64 ¶
type ActionInt64 func(v int64)
type ActionObjErr ¶
type ActionObjErr func(obj interface{}, err error)
type BytesBuffer ¶
type BytesBuffer struct {
// contains filtered or unexported fields
}
func NewBytesBuffer ¶
func NewBytesBuffer(data []byte) *BytesBuffer
func (*BytesBuffer) Available ¶
func (b *BytesBuffer) Available() uint32
func (*BytesBuffer) Bytes ¶
func (b *BytesBuffer) Bytes() []byte
func (*BytesBuffer) Clear ¶
func (b *BytesBuffer) Clear()
func (*BytesBuffer) Copy ¶
func (b *BytesBuffer) Copy() []byte
func (*BytesBuffer) Length ¶
func (b *BytesBuffer) Length() uint32
func (*BytesBuffer) Mark ¶
func (b *BytesBuffer) Mark()
func (*BytesBuffer) Pos ¶
func (b *BytesBuffer) Pos() uint32
func (*BytesBuffer) RBool ¶
func (b *BytesBuffer) RBool() (v bool, err error)
func (*BytesBuffer) RBytesWithLen ¶
func (b *BytesBuffer) RBytesWithLen() (v []byte, err error)
func (*BytesBuffer) RFloat32 ¶
func (b *BytesBuffer) RFloat32() (v float32, err error)
func (*BytesBuffer) RFloat64 ¶
func (b *BytesBuffer) RFloat64() (v float64, err error)
func (*BytesBuffer) RInt32 ¶
func (b *BytesBuffer) RInt32() (v int32, err error)
func (*BytesBuffer) RInt64 ¶
func (b *BytesBuffer) RInt64() (v int64, err error)
func (*BytesBuffer) RInt8 ¶
func (b *BytesBuffer) RInt8() (v int8, err error)
func (*BytesBuffer) RStrMapStr ¶
func (b *BytesBuffer) RStrMapStr() (m map[string]string, err error)
func (*BytesBuffer) RString ¶
func (b *BytesBuffer) RString() (v string, err error)
func (*BytesBuffer) RStringNoLen ¶
func (b *BytesBuffer) RStringNoLen() (v string)
func (*BytesBuffer) RUint16 ¶
func (b *BytesBuffer) RUint16() (v uint16, err error)
func (*BytesBuffer) RUint32 ¶
func (b *BytesBuffer) RUint32() (v uint32, err error)
func (*BytesBuffer) RUint64 ¶
func (b *BytesBuffer) RUint64() (v uint64, err error)
func (*BytesBuffer) RUint8 ¶
func (b *BytesBuffer) RUint8() (v uint8, err error)
func (*BytesBuffer) RVec2 ¶
func (b *BytesBuffer) RVec2() (v Vec2, err error)
func (*BytesBuffer) RVec3 ¶
func (b *BytesBuffer) RVec3() (v Vec3, err error)
func (*BytesBuffer) RVec4 ¶
func (b *BytesBuffer) RVec4() (v Vec4, err error)
func (*BytesBuffer) RVecInt2 ¶
func (b *BytesBuffer) RVecInt2() (v VecInt2, err error)
func (*BytesBuffer) RVecInt3 ¶
func (b *BytesBuffer) RVecInt3() (v VecInt3, err error)
func (*BytesBuffer) RVecInt4 ¶
func (b *BytesBuffer) RVecInt4() (v VecInt4, err error)
func (*BytesBuffer) ResetMark ¶
func (b *BytesBuffer) ResetMark()
func (*BytesBuffer) Rint16 ¶
func (b *BytesBuffer) Rint16() (v int16, err error)
func (*BytesBuffer) SetData ¶
func (b *BytesBuffer) SetData(bytes []byte)
func (*BytesBuffer) SetPos ¶
func (b *BytesBuffer) SetPos(v uint32) error
func (*BytesBuffer) ToHex ¶
func (b *BytesBuffer) ToHex() string
func (*BytesBuffer) WBool ¶
func (b *BytesBuffer) WBool(v bool)
func (*BytesBuffer) WBytes ¶
func (b *BytesBuffer) WBytes(v []byte)
func (*BytesBuffer) WBytesWithLen ¶
func (b *BytesBuffer) WBytesWithLen(v []byte)
func (*BytesBuffer) WFloat32 ¶
func (b *BytesBuffer) WFloat32(v float32)
func (*BytesBuffer) WFloat64 ¶
func (b *BytesBuffer) WFloat64(v float64)
func (*BytesBuffer) WInt16 ¶
func (b *BytesBuffer) WInt16(v int16)
func (*BytesBuffer) WInt32 ¶
func (b *BytesBuffer) WInt32(v int32)
func (*BytesBuffer) WInt64 ¶
func (b *BytesBuffer) WInt64(v int64)
func (*BytesBuffer) WInt8 ¶
func (b *BytesBuffer) WInt8(v int8)
func (*BytesBuffer) WStrMapStr ¶
func (b *BytesBuffer) WStrMapStr(m map[string]string)
func (*BytesBuffer) WString ¶
func (b *BytesBuffer) WString(v string)
func (*BytesBuffer) WStringNoLen ¶
func (b *BytesBuffer) WStringNoLen(v string)
func (*BytesBuffer) WUint16 ¶
func (b *BytesBuffer) WUint16(v uint16)
func (*BytesBuffer) WUint32 ¶
func (b *BytesBuffer) WUint32(v uint32)
func (*BytesBuffer) WUint64 ¶
func (b *BytesBuffer) WUint64(v uint64)
func (*BytesBuffer) WUint8 ¶
func (b *BytesBuffer) WUint8(v uint8)
func (*BytesBuffer) WVec2 ¶
func (b *BytesBuffer) WVec2(v Vec4)
func (*BytesBuffer) WVec3 ¶
func (b *BytesBuffer) WVec3(v Vec4)
func (*BytesBuffer) WVec4 ¶
func (b *BytesBuffer) WVec4(v Vec4)
func (*BytesBuffer) WVecInt2 ¶
func (b *BytesBuffer) WVecInt2(v VecInt2)
func (*BytesBuffer) WVecInt3 ¶
func (b *BytesBuffer) WVecInt3(v VecInt3)
func (*BytesBuffer) WVecInt4 ¶
func (b *BytesBuffer) WVecInt4(v VecInt4)
type EnableAction ¶
type EnableAction struct {
// contains filtered or unexported fields
}
func NewEnableAction ¶
func NewEnableAction() *EnableAction
func (*EnableAction) Action ¶
func (e *EnableAction) Action(action func()) bool
func (*EnableAction) Close ¶
func (e *EnableAction) Close(action func()) bool
func (*EnableAction) Reset ¶
func (e *EnableAction) Reset()
type IData ¶
type IData interface { Data() map[string]interface{} Set(key string, val interface{}) Get(key string) (interface{}, bool) Pop(key string) (interface{}, bool) Remove(key string) Has(key string) bool Must(key string, defVal interface{}) interface{} Bool(key string) (bool, bool) MustBool(key string, defVal bool) bool Int16(key string) (int16, bool) MustInt16(key string, defVal int16) int16 Int(key string) (int, bool) MustInt(key string, defVal int) int Int32(key string) (int32, bool) MustInt32(key string, defVal int32) int32 Int64(key string) (int64, bool) MustInt64(key string, defVal int64) int64 Uint8(key string) (uint8, bool) MustUint8(key string, defVal uint8) uint8 Uint16(key string) (uint16, bool) MustUint16(key string, defVal uint16) uint16 Uint(key string) (uint, bool) MustUint(key string, defVal uint) uint Uint32(key string) (uint32, bool) MustUint32(key string, defVal uint32) uint32 Uint64(key string) (uint64, bool) MustUint64(key string, defVal uint64) uint64 Float32(key string) (float32, bool) MustFloat32(key string, defVal float32) float32 Float64(key string) (float64, bool) MustFloat64(key string, defVal float64) float64 String(key string) (string, bool) MustString(key string, defVal string) string Strings(key string) ([]string, bool) MustStrings(key string, defVal []string) []string Reset() }
type IObject ¶
type IObject interface { Set(v interface{}, paths ...interface{}) error Get(paths ...interface{}) (interface{}, error) Must(val interface{}, paths ...interface{}) interface{} Bool(paths ...interface{}) (bool, error) MustBool(val bool, paths ...interface{}) bool Int16(paths ...interface{}) (int16, error) MustInt16(val int16, paths ...interface{}) int16 Int(paths ...interface{}) (int, error) MustInt(val int, paths ...interface{}) int Int32(paths ...interface{}) (int32, error) MustInt32(val int32, paths ...interface{}) int32 Int64(paths ...interface{}) (int64, error) MustInt64(val int64, paths ...interface{}) int64 Uint8(paths ...interface{}) (uint8, error) MustUint8(val uint8, paths ...interface{}) uint8 Uint16(paths ...interface{}) (uint16, error) MustUint16(val uint16, paths ...interface{}) uint16 Uint(paths ...interface{}) (uint, error) MustUint(val uint, paths ...interface{}) uint Uint32(paths ...interface{}) (uint32, error) MustUint32(val uint32, paths ...interface{}) uint32 Uint64(paths ...interface{}) (uint64, error) MustUint64(val uint64, paths ...interface{}) uint64 Float32(paths ...interface{}) (float32, error) MustFloat32(val float32, paths ...interface{}) float32 Float64(paths ...interface{}) (float64, error) MustFloat64(val float64, paths ...interface{}) float64 String(paths ...interface{}) (string, error) MustString(val string, paths ...interface{}) string Strings(paths ...interface{}) ([]string, error) MustStrings(val []string, paths ...interface{}) []string Data() map[string]interface{} }
type IWeightSelector ¶
type IWorkerManager ¶
type Tuple4 ¶
type Tuple4 struct { Item1 interface{} Item2 interface{} Item3 interface{} Item4 interface{} }
type Tuple5 ¶
type Tuple5 struct { Item1 interface{} Item2 interface{} Item3 interface{} Item4 interface{} Item5 interface{} }
type Tuple6 ¶
type Tuple6 struct { Item1 interface{} Item2 interface{} Item3 interface{} Item4 interface{} Item5 interface{} Item6 interface{} }
type Vec2 ¶
func Vec2Normalize ¶
type Vec3 ¶
func Vec3Normalize ¶
Click to show internal directories.
Click to hide internal directories.