Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(d float32) float32
- func ArgsToSlc[T any](args ...T) []T
- func BytesToInt64(bytes []byte) int64
- func BytesToStr(b []byte) string
- func Cancel()
- func Ceil(d float32, bit int32) float32
- func CeilInt32(ceil, v int32) (r, o int32)
- func Clamp(min, max, v float32) float32
- func ClampFloat(v, min, max float32) float32
- func ClampInt32(min, max, v int32) int32
- func Cmp(v1, v2 float32) int
- func CmpZero(v float32) int
- func CopyBytes(src []byte) []byte
- func Ctx() context.Context
- func Default[T any]() (v T)
- func DefaultCmd(m M)
- func DegreeToRadian(angle float32) float32
- func Equal(v1, v2 float32) bool
- func ErrCodeToStr(ec TErrCode) string
- func ExeName() string
- func Floor(d float32, bit int32) float32
- func FloorInt32(floor, v int32) (r, o int32)
- func GenMask(items ...int64) int64
- func GetDiskPercent() float64
- func GetMemPercent() float64
- func GetStack(skip int) []byte
- func GobMarshal(v any) ([]byte, error)
- func GobUnmarshal(data []byte, v any) error
- func Hex(bytes []byte) string
- func Int64ToBs(id int64) string
- func Int64ToBytes(id int64) []byte
- func Int64sToShortStrSlice(ids ...int64) []string
- func IsLocalIp(ip string) bool
- func IsPowerOfTwo(mask int32) bool
- func JsonConf() jsoniter.API
- func Lerp(from, to, t float32) float32
- func LerpFloat(v1, v2, v float32) float32
- func LerpInt(v1, v2, v, t int) int
- func LogTrim(file string) string
- func MGet[T any](m M, key string) (T, bool)
- func MGet2[T any](m M, keys ...string) (T, bool)
- func MGetOrSet[T any](m M, key string, new func() T) T
- func MPop[T any](m M, key string) (T, bool)
- func MReplace[T any](m M, key string, val T) (T, bool)
- func MUpdate[T any](m M, key string, fn func(T) T) bool
- func MaskAddItem(item, mask int64) int64
- func MaskDelItem(item, mask int64) int64
- func Max(l, r float32) float32
- func MaxInt(a, b int) int
- func MaxInt32(a, b int32) int32
- func MaxInt64(a, b int64) int64
- func MaxUint32(a, b uint32) uint32
- func MergeUInt32(prevId, lastId uint16) uint32
- func Min(l, r float32) float32
- func MinInt32(a, b int32) int32
- func MinInt64(a, b int64) int64
- func MinUint32(a, b uint32) uint32
- func NextPowerOfTwo(v uint32) uint32
- func PbMarshal(pkt IMsg) ([]byte, error)
- func PbUnmarshal(data []byte, pkt IMsg) error
- func PointInTriangle(p, a, b, c Vec2) bool
- func PointOnSeg(p, a, b Vec2) bool
- func PointToSegDist(p, a, b Vec2) float32
- func PointToSegDistSquare(p, a, b Vec2) float32
- func PointToVecDist(p, a, b Vec2) float32
- func PointToVecDistSquare(p, a, b Vec2) float32
- func RadianToDegree(radian float32) float32
- func RandStr(n int) string
- func RecycleBytes(bytes []byte)
- func RecycleCounter(c *Counter)
- func Round(d float32, bit int32) float32
- func SetErrCodeToStr(ec TErrCode, str string)
- func SetExeDir(dir string)
- func SetJsonConf(conf jsoniter.Config)
- func ShortStrToInt64(id string) int64
- func ShortStrToUint16(id string) uint16
- func ShortStrToUint32(id string) uint32
- func ShortStrToUint64(id string) uint64
- func SpawnBytes() []byte
- func SpawnBytesWithLen(l uint32) []byte
- func SplitSlc1[T any](slc []any) T
- func SplitSlc2[T1, T2 any](slc []any) (T1, T2)
- func SplitSlc3[T1, T2, T3 any](slc []any) (T1, T2, T3)
- func SplitSlc4[T1, T2, T3, T4 any](slc []any) (T1, T2, T3, T4)
- func SplitSlc5[T1, T2, T3, T4, T5 any](slc []any) (T1, T2, T3, T4, T5)
- func SplitSlc6[T1, T2, T3, T4, T5, T6 any](slc []any) (T1, T2, T3, T4, T5, T6)
- func SplitSlc7[T1, T2, T3, T4, T5, T6, T7 any](slc []any) (T1, T2, T3, T4, T5, T6, T7)
- func SplitSlc8[T1, T2, T3, T4, T5, T6, T7, T8 any](slc []any) (T1, T2, T3, T4, T5, T6, T7, T8)
- func SplitUInt32(code uint32) (prevId, lastId uint16)
- func SplitWords(str string, words *[]string)
- func Sqrt(v float32) float32
- func StartProfile(dur time.Duration, receiver chan<- M)
- func StrToBytes(s string) []byte
- func StringsJoin(sep string, slc ...string) string
- func TestMask(item, mask int64) bool
- func ToBigHump(str string) string
- func ToUnderline(str string) string
- func TriangleArea(a, b, c Vec2) float32
- func Uint16ToShortStr(id uint16) string
- func Uint32ToShortStr(id uint32) string
- func Uint64ToShortStr(id uint64) string
- func Vec2Cross(a, b Vec2) float32
- func Vec2Dist(a, b Vec2) float32
- func Vec2DistSquare(a, b Vec2) float32
- func Vec2Dot(a, b Vec2) float32
- func Vec2Equal(a, b Vec2) bool
- func Vec2Magnitude(a Vec2) float32
- func Vec2Radian(a, b Vec2) float32
- func Vec2ToRadian(a Vec2) float32
- func WorkDir() string
- type AnyBoolToAnyBool
- type AnyBoolToBool
- type AnyErrToBool
- type AnyToAny
- type AnyToAnyBool
- type AnyToBool
- type AnyToBytesError
- type AnyToErr
- type AnyToInt64
- type BoolToErr
- type ByteBuffer
- func (b *ByteBuffer) All() []byte
- func (b *ByteBuffer) Available() uint32
- func (b *ByteBuffer) Cap() uint32
- func (b *ByteBuffer) CopyBytes() ([]byte, uint32)
- func (b *ByteBuffer) Dispose()
- func (b *ByteBuffer) InitBytes(bytes []byte)
- func (b *ByteBuffer) InitCap(c uint32)
- func (b *ByteBuffer) Length() uint32
- func (b *ByteBuffer) Pos() uint32
- func (b *ByteBuffer) RAny() (v any, err *Err)
- func (b *ByteBuffer) RAnyMAny(m map[any]any) (err *Err)
- func (b *ByteBuffer) RAvailable() (v []byte)
- func (b *ByteBuffer) RBool() (v bool, err *Err)
- func (b *ByteBuffer) RBools() (v []bool, err *Err)
- func (b *ByteBuffer) RBytes() ([]byte, *Err)
- func (b *ByteBuffer) RErr() (e *Err, re *Err)
- func (b *ByteBuffer) RFloat32() (v float32, err *Err)
- func (b *ByteBuffer) RFloat32s() (v []float32, err *Err)
- func (b *ByteBuffer) RFloat64() (v float64, err *Err)
- func (b *ByteBuffer) RFloat64s() (v []float64, err *Err)
- func (b *ByteBuffer) RInt() (v int, err *Err)
- func (b *ByteBuffer) RInt16() (v int16, err *Err)
- func (b *ByteBuffer) RInt16s() (v []int16, err *Err)
- func (b *ByteBuffer) RInt32() (v int32, err *Err)
- func (b *ByteBuffer) RInt32MInt32() (m map[int32]int32, err *Err)
- func (b *ByteBuffer) RInt32MInt64() (m map[int32]int64, err *Err)
- func (b *ByteBuffer) RInt32s() (v []int32, err *Err)
- func (b *ByteBuffer) RInt64() (v int64, err *Err)
- func (b *ByteBuffer) RInt64MInt32() (m map[int64]int32, err *Err)
- func (b *ByteBuffer) RInt64MInt64() (m map[int64]int64, err *Err)
- func (b *ByteBuffer) RInt64s() (v []int64, err *Err)
- func (b *ByteBuffer) RInt8() (v int8, err *Err)
- func (b *ByteBuffer) RInt8s() (v []int8, err *Err)
- func (b *ByteBuffer) RInts() (v []int, err *Err)
- func (b *ByteBuffer) RJson(v any) *Err
- func (b *ByteBuffer) RMAny(m M) (err *Err)
- func (b *ByteBuffer) RMInt32() (m map[string]int32, err *Err)
- func (b *ByteBuffer) RMInt64() (m map[string]int64, err *Err)
- func (b *ByteBuffer) RMStr() (m MS, err *Err)
- func (b *ByteBuffer) RShortString() (v string, err *Err)
- func (b *ByteBuffer) RString() (v string, err *Err)
- func (b *ByteBuffer) RStringNoLen() (v string)
- func (b *ByteBuffer) RStrings() (v []string, err *Err)
- func (b *ByteBuffer) RUint16() (v uint16, err *Err)
- func (b *ByteBuffer) RUint16MUint16() (m map[uint16]uint16, err *Err)
- func (b *ByteBuffer) RUint16s() (v []uint16, err *Err)
- func (b *ByteBuffer) RUint32() (v uint32, err *Err)
- func (b *ByteBuffer) RUint32s() (v []uint32, err *Err)
- func (b *ByteBuffer) RUint64() (v uint64, err *Err)
- func (b *ByteBuffer) RUint64s() (v []uint64, err *Err)
- func (b *ByteBuffer) RUint8() (v uint8, err *Err)
- func (b *ByteBuffer) RUint8s() (v []uint8, err *Err)
- func (b *ByteBuffer) RVec2() (v Vec2, err *Err)
- func (b *ByteBuffer) RVec2s() (v []Vec2, err *Err)
- func (b *ByteBuffer) RVec3() (v Vec3, err *Err)
- func (b *ByteBuffer) RVec3s() (v []Vec3, err *Err)
- func (b *ByteBuffer) Read(p []byte) (n int, err error)
- func (b *ByteBuffer) Reset()
- func (b *ByteBuffer) SetPos(v uint32)
- func (b *ByteBuffer) ToHex() string
- func (b *ByteBuffer) WAny(v any) *Err
- func (b *ByteBuffer) WAny2(m map[any]any) (err *Err)
- func (b *ByteBuffer) WAnyMAny(m map[any]any) *Err
- func (b *ByteBuffer) WBool(v bool)
- func (b *ByteBuffer) WBools(v []bool)
- func (b *ByteBuffer) WBytes(v []byte)
- func (b *ByteBuffer) WErr(err *Err) *Err
- func (b *ByteBuffer) WFloat32(v float32)
- func (b *ByteBuffer) WFloat32s(v []float32)
- func (b *ByteBuffer) WFloat64(v float64)
- func (b *ByteBuffer) WFloat64s(v []float64)
- func (b *ByteBuffer) WInt(v int)
- func (b *ByteBuffer) WInt16(v int16)
- func (b *ByteBuffer) WInt16s(v []int16)
- func (b *ByteBuffer) WInt32(v int32)
- func (b *ByteBuffer) WInt32MInt32(m map[int32]int32)
- func (b *ByteBuffer) WInt32MInt64(m map[int32]int64)
- func (b *ByteBuffer) WInt32s(v []int32)
- func (b *ByteBuffer) WInt64(v int64)
- func (b *ByteBuffer) WInt64MInt32(m map[int64]int32)
- func (b *ByteBuffer) WInt64MInt64(m map[int64]int64)
- func (b *ByteBuffer) WInt64s(v []int64)
- func (b *ByteBuffer) WInt8(v int8)
- func (b *ByteBuffer) WInt8s(v []int8)
- func (b *ByteBuffer) WInts(v []int)
- func (b *ByteBuffer) WJson(o any) *Err
- func (b *ByteBuffer) WMAny(m M) *Err
- func (b *ByteBuffer) WMInt32(m map[string]int32)
- func (b *ByteBuffer) WMInt64(m map[string]int64)
- func (b *ByteBuffer) WMStr(m MS)
- func (b *ByteBuffer) WShortString(v string)
- func (b *ByteBuffer) WString(v string)
- func (b *ByteBuffer) WStringNoLen(v string)
- func (b *ByteBuffer) WStrings(v []string)
- func (b *ByteBuffer) WUint16(v uint16)
- func (b *ByteBuffer) WUint16MUint16(m map[uint16]uint16)
- func (b *ByteBuffer) WUint16s(v []uint16)
- func (b *ByteBuffer) WUint32(v uint32)
- func (b *ByteBuffer) WUint32s(v []uint32)
- func (b *ByteBuffer) WUint64(v uint64)
- func (b *ByteBuffer) WUint64s(v []uint64)
- func (b *ByteBuffer) WUint8(v uint8)
- func (b *ByteBuffer) WUint8s(v []uint8)
- func (b *ByteBuffer) WVec2(v Vec2)
- func (b *ByteBuffer) WVec2s(v []Vec2)
- func (b *ByteBuffer) WVec3(v Vec3)
- func (b *ByteBuffer) WVec3s(v []Vec3)
- func (b *ByteBuffer) Write(v []byte) (int, error)
- func (b *ByteBuffer) WriteTo(writer io.Writer) (n int, err error)
- type BytesAnyToErr
- type BytesAnyToError
- type BytesToAnyErr
- type BytesToBytes
- type BytesToErr
- type BytesToInt642Err
- type BytesToM
- type BytesToUint16
- type BytesToUint32
- type CmdHandler
- type Command
- type Compare
- type Counter
- type Enable
- func (e *Enable) Disable(fn FnAnySlc, params ...any) bool
- func (e *Enable) Disabled() bool
- func (e *Enable) Enable(fn FnAnySlc, params ...any) bool
- func (e *Enable) IfDisable(fn Fn) (ok bool)
- func (e *Enable) IfEnable(fn Fn) (ok bool)
- func (e *Enable) RAction(fn FnAnySlc, params ...any) *Err
- func (e *Enable) WAction(fn FnAnySlc, params ...any) *Err
- func (e *Enable) WAction2(fn Fn) *Err
- type Err
- func CheckLocalIp(ip string) (string, *Err)
- func GetCpuPercent() (float64, *Err)
- func GetLocalIp() (string, *Err)
- func JsonMarshal(o any) ([]byte, *Err)
- func JsonMarshalIndent(o any, prefix, indent string) ([]byte, *Err)
- func JsonUnmarshal(bytes []byte, o any) *Err
- func NewErr(code TErrCode, params M) *Err
- func NewErrWithStack(code TErrCode, stack []byte, params M) *Err
- func NewM(bytes []byte, m M) *Err
- func NewNoStackErr(code TErrCode, params M) *Err
- func ParseAddrPort(addr string) (int, *Err)
- func ParseInt[T Num](s string) (v T, err *Err)
- func SplitInt64(sep, str string) ([]int64, *Err)
- func SplitUint16(sep, str string) ([]uint16, *Err)
- func WrapErr(code TErrCode, e error) *Err
- func (e *Err) AddParam(k string, v any)
- func (e *Err) AddParams(params M)
- func (e *Err) Code() TErrCode
- func (e *Err) Error() string
- func (e *Err) GetParam(k string) (v any, ok bool)
- func (e *Err) IsNoStack() bool
- func (e *Err) Params() M
- func (e *Err) Stack() []byte
- func (e *Err) String() string
- func (e *Err) ToBytes() []byte
- func (e *Err) UpdateParam(k string, action AnyBoolToAnyBool)
- type Fn
- type FnAny
- type FnAnyErr
- type FnAnySlc
- type FnAnySlc2
- type FnBool
- type FnBoolErr
- type FnBytes
- type FnBytesSlc
- type FnErr
- type FnInt
- type FnInt32
- type FnInt64
- type FnInt642
- type FnInt642Any
- type FnInt642Bool
- type FnInt642Err
- type FnInt643
- type FnInt64Any
- type FnInt64Bool
- type FnInt64Bytes
- type FnInt64Err
- type FnInt64M
- type FnInt64MBytes
- type FnInt64MErr
- type FnInt64MMsg
- type FnInt64MUint16
- type FnInt64Str
- type FnInt64StrBool
- type FnIntAnySlc
- type FnIntAnySlc2
- type FnM
- type FnM2Bool
- type FnMAny
- type FnMBool
- type FnMErr
- type FnMUint32
- type FnMapBool
- type FnMsg
- type FnStr
- type FnStr2Bool
- type FnStrAny
- type FnStrBool
- type FnStrBytes
- type FnStrErr
- type FnStrFn
- type FnStrSlc
- type FnUint16
- type FnUint162Int642Bytes
- type FnUint16Bool
- type FnUint16Bytes
- type FnUint16Err
- type FnUint16Int642Bytes
- type FnUint32
- type IMsg
- type Id
- type Int64AnyToBool
- type Int64ToBool
- type Int64ToErrCode
- type Int64ToInt64
- type Int64ToInt64Err
- type Int64ToStr
- type Int64ToStrErr
- type M
- func (m M) Copy(toM M) M
- func (m M) CopyTo(n M)
- func (m M) Del(key string)
- func (m M) FromBytes(bytes []byte) *Err
- func (m M) FromGob(bytes []byte) *Err
- func (m M) FromJson(bytes []byte) *Err
- func (m M) Get(key string) (any, bool)
- func (m M) Has(key string) (ok bool)
- func (m M) IndentJson() []byte
- func (m M) MustGet(key string, def any) any
- func (m M) Replace(key string, val any) (oldVal any, ok bool)
- func (m M) Set(key string, val any)
- func (m M) Set2(val any, keys ...string) *Err
- func (m M) ToBytes() ([]byte, *Err)
- func (m M) ToGob() ([]byte, *Err)
- func (m M) ToJson() ([]byte, *Err)
- func (m M) ToSlice(slc *[]any)
- func (m M) Update(key string, action AnyToAny) (ok bool)
- type M32
- type M64
- type MF32
- type MF64
- type MS
- type MToAny
- type MToBool
- type MToBytes
- type MToErr
- type MToInt64
- type Num
- type Pool
- type PoolOption
- type Str162ErrToBytesErr
- type Str2BytesToBytesErr
- type Str2Int64ToBoolBytes
- type StrAnyToErr
- type StrBytesToBool
- type StrFnToErr
- type StrInt64ToBool
- type StrIntToBool
- type StrToBool
- type StrToBytesErr
- type StrToStr
- type StrToStr2Err
- type TErrCode
- type ToAny
- type ToBool
- type ToErr
- type ToErrCode
- type ToFnInt64Fn
- type ToInt64
- type ToM
- type ToMsg
- type ToStr
- type ToStrBool
- type Tuple2
- type Tuple3
- type Tuple4
- type Tuple5
- type Uint16Int64ToUint16
- type Uint16ToBool
- type Vec2
- func PointToSegNearPoint(p, a, b Vec2) Vec2
- func PointToVecNearPoint(p, a, b Vec2) Vec2
- func RandDir() Vec2
- func RandRange(center Vec2, radius float32) Vec2
- func Vec2Add(a, b Vec2) Vec2
- func Vec2Clamp(v, min, max Vec2) Vec2
- func Vec2Div(a Vec2, v float32) Vec2
- func Vec2Lerp(a, b Vec2, v float32) Vec2
- func Vec2Mul(a Vec2, v float32) Vec2
- func Vec2Normalize(v Vec2) Vec2
- func Vec2One() Vec2
- func Vec2Rotate(a Vec2, radian float32) Vec2
- func Vec2Rotate180(v Vec2) Vec2
- func Vec2Rotate270(a Vec2) Vec2
- func Vec2Rotate90(a Vec2) Vec2
- func Vec2Sub(a, b Vec2) Vec2
- func Vec2XRebound(a, b Vec2, bound float32) (Vec2, bool)
- func Vec2YRebound(a, b Vec2, bound float32) (Vec2, bool)
- type Vec2Int
- type Vec3
Constants ¶
View Source
const ( Bool _BT = iota Bools Bytes Uint8 Int8 Int8s Uint16 Uint16s Int16 Int16s Int Ints Uint32 Uint32s Int32 Int32s Uint64 Uint64s Int64 Int64s Float32 Float32s Float64 Float64s Vector2 Vector2s Vector3 Vector3s Str Strs Time Times MInt32 MInt64 MStr MAny Uint16MUint16 Int32MInt32 Int32MInt64 Int64MInt32 Int64MInt64 AnyMAny )
View Source
const ( Rad2Deg float32 = 180 / math.Pi Deg2Rad float32 = math.Pi / 180 HalfPi float32 = math.Pi / 2 Eps float32 = 1e-5 )
View Source
const ( Cpu = "cpu" Memory = "mem" Disk = "disk" Goroutine = "goroutine" )
Variables ¶
View Source
var ( StackMaxDeep = 8 LogPrefix = ".." LogReg = regexp.MustCompile(`(\/.+\.(com)|(org))|(\/.+go\d{1}\.\d{1,2}.\d{1,2}|/src)`) )
Functions ¶
func BytesToInt64 ¶
func BytesToStr ¶
func ClampFloat ¶
func ClampInt32 ¶
func DefaultCmd ¶
func DefaultCmd(m M)
func DegreeToRadian ¶
func ErrCodeToStr ¶
func FloorInt32 ¶
func GetDiskPercent ¶
func GetDiskPercent() float64
func GetMemPercent ¶
func GetMemPercent() float64
func GobMarshal ¶
func GobUnmarshal ¶
func Int64ToBytes ¶
func Int64sToShortStrSlice ¶
func IsPowerOfTwo ¶
func MaskAddItem ¶
func MaskDelItem ¶
func MergeUInt32 ¶
func NextPowerOfTwo ¶
func PbUnmarshal ¶
func PointInTriangle ¶
func PointToSegDistSquare ¶
func PointToVecDist ¶
func PointToVecDistSquare ¶
func RadianToDegree ¶
func RecycleBytes ¶
func RecycleBytes(bytes []byte)
func RecycleCounter ¶
func RecycleCounter(c *Counter)
func SetErrCodeToStr ¶
func SetJsonConf ¶
func ShortStrToInt64 ¶
func ShortStrToUint16 ¶
func ShortStrToUint32 ¶
func ShortStrToUint64 ¶
func SpawnBytes ¶
func SpawnBytes() []byte
func SpawnBytesWithLen ¶
func SplitUInt32 ¶
func SplitWords ¶
func StartProfile ¶
func StrToBytes ¶
func StringsJoin ¶
func ToUnderline ¶
func Uint16ToShortStr ¶
func Uint32ToShortStr ¶
func Uint64ToShortStr ¶
func Vec2DistSquare ¶
func Vec2Magnitude ¶
func Vec2Radian ¶
func Vec2ToRadian ¶
Types ¶
type AnyBoolToBool ¶
type AnyErrToBool ¶
type AnyToAnyBool ¶
type AnyToBytesError ¶
type AnyToInt64 ¶
type ByteBuffer ¶
type ByteBuffer struct {
// contains filtered or unexported fields
}
func (*ByteBuffer) All ¶
func (b *ByteBuffer) All() []byte
func (*ByteBuffer) Available ¶
func (b *ByteBuffer) Available() uint32
func (*ByteBuffer) Cap ¶
func (b *ByteBuffer) Cap() uint32
func (*ByteBuffer) CopyBytes ¶
func (b *ByteBuffer) CopyBytes() ([]byte, uint32)
func (*ByteBuffer) InitBytes ¶
func (b *ByteBuffer) InitBytes(bytes []byte)
func (*ByteBuffer) InitCap ¶
func (b *ByteBuffer) InitCap(c uint32)
func (*ByteBuffer) Length ¶
func (b *ByteBuffer) Length() uint32
func (*ByteBuffer) Pos ¶
func (b *ByteBuffer) Pos() uint32
func (*ByteBuffer) RAny ¶
func (b *ByteBuffer) RAny() (v any, err *Err)
func (*ByteBuffer) RBool ¶
func (b *ByteBuffer) RBool() (v bool, err *Err)
func (*ByteBuffer) RBools ¶
func (b *ByteBuffer) RBools() (v []bool, err *Err)
func (*ByteBuffer) RBytes ¶
func (b *ByteBuffer) RBytes() ([]byte, *Err)
func (*ByteBuffer) RErr ¶
func (b *ByteBuffer) RErr() (e *Err, re *Err)
func (*ByteBuffer) RFloat32 ¶
func (b *ByteBuffer) RFloat32() (v float32, err *Err)
func (*ByteBuffer) RFloat32s ¶
func (b *ByteBuffer) RFloat32s() (v []float32, err *Err)
func (*ByteBuffer) RFloat64 ¶
func (b *ByteBuffer) RFloat64() (v float64, err *Err)
func (*ByteBuffer) RFloat64s ¶
func (b *ByteBuffer) RFloat64s() (v []float64, err *Err)
func (*ByteBuffer) RInt ¶
func (b *ByteBuffer) RInt() (v int, err *Err)
func (*ByteBuffer) RInt16 ¶
func (b *ByteBuffer) RInt16() (v int16, err *Err)
func (*ByteBuffer) RInt16s ¶
func (b *ByteBuffer) RInt16s() (v []int16, err *Err)
func (*ByteBuffer) RInt32 ¶
func (b *ByteBuffer) RInt32() (v int32, err *Err)
func (*ByteBuffer) RInt32MInt32 ¶
func (b *ByteBuffer) RInt32MInt32() (m map[int32]int32, err *Err)
func (*ByteBuffer) RInt32MInt64 ¶
func (b *ByteBuffer) RInt32MInt64() (m map[int32]int64, err *Err)
func (*ByteBuffer) RInt32s ¶
func (b *ByteBuffer) RInt32s() (v []int32, err *Err)
func (*ByteBuffer) RInt64 ¶
func (b *ByteBuffer) RInt64() (v int64, err *Err)
func (*ByteBuffer) RInt64MInt32 ¶
func (b *ByteBuffer) RInt64MInt32() (m map[int64]int32, err *Err)
func (*ByteBuffer) RInt64MInt64 ¶
func (b *ByteBuffer) RInt64MInt64() (m map[int64]int64, err *Err)
func (*ByteBuffer) RInt64s ¶
func (b *ByteBuffer) RInt64s() (v []int64, err *Err)
func (*ByteBuffer) RInt8 ¶
func (b *ByteBuffer) RInt8() (v int8, err *Err)
func (*ByteBuffer) RInt8s ¶
func (b *ByteBuffer) RInt8s() (v []int8, err *Err)
func (*ByteBuffer) RInts ¶
func (b *ByteBuffer) RInts() (v []int, err *Err)
func (*ByteBuffer) RJson ¶
func (b *ByteBuffer) RJson(v any) *Err
func (*ByteBuffer) RMAny ¶
func (b *ByteBuffer) RMAny(m M) (err *Err)
func (*ByteBuffer) RMStr ¶
func (b *ByteBuffer) RMStr() (m MS, err *Err)
func (*ByteBuffer) RShortString ¶
func (b *ByteBuffer) RShortString() (v string, err *Err)
func (*ByteBuffer) RString ¶
func (b *ByteBuffer) RString() (v string, err *Err)
func (*ByteBuffer) RStringNoLen ¶
func (b *ByteBuffer) RStringNoLen() (v string)
func (*ByteBuffer) RStrings ¶
func (b *ByteBuffer) RStrings() (v []string, err *Err)
func (*ByteBuffer) RUint16 ¶
func (b *ByteBuffer) RUint16() (v uint16, err *Err)
func (*ByteBuffer) RUint16MUint16 ¶
func (b *ByteBuffer) RUint16MUint16() (m map[uint16]uint16, err *Err)
func (*ByteBuffer) RUint16s ¶
func (b *ByteBuffer) RUint16s() (v []uint16, err *Err)
func (*ByteBuffer) RUint32 ¶
func (b *ByteBuffer) RUint32() (v uint32, err *Err)
func (*ByteBuffer) RUint32s ¶
func (b *ByteBuffer) RUint32s() (v []uint32, err *Err)
func (*ByteBuffer) RUint64 ¶
func (b *ByteBuffer) RUint64() (v uint64, err *Err)
func (*ByteBuffer) RUint64s ¶
func (b *ByteBuffer) RUint64s() (v []uint64, err *Err)
func (*ByteBuffer) RUint8 ¶
func (b *ByteBuffer) RUint8() (v uint8, err *Err)
func (*ByteBuffer) RUint8s ¶
func (b *ByteBuffer) RUint8s() (v []uint8, err *Err)
func (*ByteBuffer) RVec2 ¶
func (b *ByteBuffer) RVec2() (v Vec2, err *Err)
func (*ByteBuffer) RVec2s ¶
func (b *ByteBuffer) RVec2s() (v []Vec2, err *Err)
func (*ByteBuffer) RVec3 ¶
func (b *ByteBuffer) RVec3() (v Vec3, err *Err)
func (*ByteBuffer) RVec3s ¶
func (b *ByteBuffer) RVec3s() (v []Vec3, err *Err)
func (*ByteBuffer) Reset ¶
func (b *ByteBuffer) Reset()
func (*ByteBuffer) SetPos ¶
func (b *ByteBuffer) SetPos(v uint32)
func (*ByteBuffer) ToHex ¶
func (b *ByteBuffer) ToHex() string
func (*ByteBuffer) WAny ¶
func (b *ByteBuffer) WAny(v any) *Err
func (*ByteBuffer) WBool ¶
func (b *ByteBuffer) WBool(v bool)
func (*ByteBuffer) WBools ¶
func (b *ByteBuffer) WBools(v []bool)
func (*ByteBuffer) WBytes ¶
func (b *ByteBuffer) WBytes(v []byte)
func (*ByteBuffer) WErr ¶
func (b *ByteBuffer) WErr(err *Err) *Err
func (*ByteBuffer) WFloat32 ¶
func (b *ByteBuffer) WFloat32(v float32)
func (*ByteBuffer) WFloat32s ¶
func (b *ByteBuffer) WFloat32s(v []float32)
func (*ByteBuffer) WFloat64 ¶
func (b *ByteBuffer) WFloat64(v float64)
func (*ByteBuffer) WFloat64s ¶
func (b *ByteBuffer) WFloat64s(v []float64)
func (*ByteBuffer) WInt ¶
func (b *ByteBuffer) WInt(v int)
func (*ByteBuffer) WInt16 ¶
func (b *ByteBuffer) WInt16(v int16)
func (*ByteBuffer) WInt16s ¶
func (b *ByteBuffer) WInt16s(v []int16)
func (*ByteBuffer) WInt32 ¶
func (b *ByteBuffer) WInt32(v int32)
func (*ByteBuffer) WInt32MInt32 ¶
func (b *ByteBuffer) WInt32MInt32(m map[int32]int32)
func (*ByteBuffer) WInt32MInt64 ¶
func (b *ByteBuffer) WInt32MInt64(m map[int32]int64)
func (*ByteBuffer) WInt32s ¶
func (b *ByteBuffer) WInt32s(v []int32)
func (*ByteBuffer) WInt64 ¶
func (b *ByteBuffer) WInt64(v int64)
func (*ByteBuffer) WInt64MInt32 ¶
func (b *ByteBuffer) WInt64MInt32(m map[int64]int32)
func (*ByteBuffer) WInt64MInt64 ¶
func (b *ByteBuffer) WInt64MInt64(m map[int64]int64)
func (*ByteBuffer) WInt64s ¶
func (b *ByteBuffer) WInt64s(v []int64)
func (*ByteBuffer) WInt8 ¶
func (b *ByteBuffer) WInt8(v int8)
func (*ByteBuffer) WInt8s ¶
func (b *ByteBuffer) WInt8s(v []int8)
func (*ByteBuffer) WInts ¶
func (b *ByteBuffer) WInts(v []int)
func (*ByteBuffer) WJson ¶
func (b *ByteBuffer) WJson(o any) *Err
func (*ByteBuffer) WMAny ¶
func (b *ByteBuffer) WMAny(m M) *Err
func (*ByteBuffer) WMInt32 ¶
func (b *ByteBuffer) WMInt32(m map[string]int32)
func (*ByteBuffer) WMInt64 ¶
func (b *ByteBuffer) WMInt64(m map[string]int64)
func (*ByteBuffer) WMStr ¶
func (b *ByteBuffer) WMStr(m MS)
func (*ByteBuffer) WShortString ¶
func (b *ByteBuffer) WShortString(v string)
func (*ByteBuffer) WString ¶
func (b *ByteBuffer) WString(v string)
func (*ByteBuffer) WStringNoLen ¶
func (b *ByteBuffer) WStringNoLen(v string)
func (*ByteBuffer) WStrings ¶
func (b *ByteBuffer) WStrings(v []string)
func (*ByteBuffer) WUint16 ¶
func (b *ByteBuffer) WUint16(v uint16)
func (*ByteBuffer) WUint16MUint16 ¶
func (b *ByteBuffer) WUint16MUint16(m map[uint16]uint16)
func (*ByteBuffer) WUint16s ¶
func (b *ByteBuffer) WUint16s(v []uint16)
func (*ByteBuffer) WUint32 ¶
func (b *ByteBuffer) WUint32(v uint32)
func (*ByteBuffer) WUint32s ¶
func (b *ByteBuffer) WUint32s(v []uint32)
func (*ByteBuffer) WUint64 ¶
func (b *ByteBuffer) WUint64(v uint64)
func (*ByteBuffer) WUint64s ¶
func (b *ByteBuffer) WUint64s(v []uint64)
func (*ByteBuffer) WUint8 ¶
func (b *ByteBuffer) WUint8(v uint8)
func (*ByteBuffer) WUint8s ¶
func (b *ByteBuffer) WUint8s(v []uint8)
func (*ByteBuffer) WVec2 ¶
func (b *ByteBuffer) WVec2(v Vec2)
func (*ByteBuffer) WVec2s ¶
func (b *ByteBuffer) WVec2s(v []Vec2)
func (*ByteBuffer) WVec3 ¶
func (b *ByteBuffer) WVec3(v Vec3)
func (*ByteBuffer) WVec3s ¶
func (b *ByteBuffer) WVec3s(v []Vec3)
type BytesAnyToErr ¶
type BytesAnyToError ¶
type BytesToAnyErr ¶
type BytesToBytes ¶
type BytesToErr ¶
type BytesToUint16 ¶
type BytesToUint32 ¶
type CmdHandler ¶
type Command ¶
type Command[T any] struct { // contains filtered or unexported fields }
func NewCommand ¶
func (*Command[T]) Bind ¶
func (c *Command[T]) Bind(name string, handler CmdHandler[T])
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func SpawnCounter ¶
type Err ¶
type Err struct {
// contains filtered or unexported fields
}
func CheckLocalIp ¶
func GetCpuPercent ¶
func GetLocalIp ¶
func JsonMarshal ¶
func JsonUnmarshal ¶
func NewNoStackErr ¶
func ParseAddrPort ¶
func SplitInt64 ¶
func SplitUint16 ¶
func (*Err) UpdateParam ¶
func (e *Err) UpdateParam(k string, action AnyBoolToAnyBool)
type FnBytesSlc ¶
type FnBytesSlc func([][]byte)
type FnInt642Any ¶
type FnInt642Bool ¶
type FnInt642Err ¶
type FnInt64Any ¶
func (FnInt64Any) Invoke ¶
func (f FnInt64Any) Invoke(v int64, obj any)
type FnInt64Bool ¶
type FnInt64Bytes ¶
type FnInt64Err ¶
func (FnInt64Err) Invoke ¶
func (f FnInt64Err) Invoke(v int64, err *Err)
type FnInt64MBytes ¶
type FnInt64MErr ¶
type FnInt64MMsg ¶
type FnInt64MUint16 ¶
type FnInt64Str ¶
func (FnInt64Str) Invoke ¶
func (f FnInt64Str) Invoke(v int64, str string)
type FnInt64StrBool ¶
type FnIntAnySlc ¶
type FnIntAnySlc2 ¶
type FnStr2Bool ¶
type FnStrBytes ¶
type FnUint16Bool ¶
type FnUint16Bytes ¶
type FnUint16Err ¶
type IMsg ¶
type IMsg interface {
ProtoReflect() protoreflect.Message
}
type Int64AnyToBool ¶
type Int64ToBool ¶
type Int64ToErrCode ¶
type Int64ToInt64 ¶
type Int64ToInt64Err ¶
type Int64ToStr ¶
type Int64ToStrErr ¶
type M ¶
func (M) IndentJson ¶
type StrAnyToErr ¶
type StrBytesToBool ¶
type StrFnToErr ¶
type StrInt64ToBool ¶
type StrIntToBool ¶
type StrToBytesErr ¶
type TErrCode ¶
type TErrCode = uint16
const ( EcMin TErrCode = iota + 60000 EcNil EcRecover EcWrongType EcBusy EcNotEnough EcNoAuth EcTimeout EcClosed EcOpened EcEmpty EcBadHead EcBadPacket EcExist EcNotExist EcMarshallErr EcUnmarshallErr EcIllegalOp EcIllegalConn EcTooManyConn EcParamsErr EcParseErr EcIo EcOutOfRange EcTooLong EcTooMuch EcLengthErr EcNotExistAgent EcSendErr EcReceiveErr EcAcceptErr EcConnectErr EcListenErr EcAddrErr EcNotImplement EcType EcWriteFail EcFail EcTooSlow EcServiceErr EcDbErr EcRedisErr EcEtcdErr )
type ToFnInt64Fn ¶
type ToFnInt64Fn func() FnStrFn
type Tuple5 ¶
type Tuple5[T1, T2, T3, T4, T5 any] struct { Item1 T1 Item2 T2 Item3 T3 Item4 T4 Item5 T5 }
type Uint16Int64ToUint16 ¶
type Uint16ToBool ¶
type Vec2 ¶
func PointToSegNearPoint ¶
func PointToVecNearPoint ¶
func Vec2Normalize ¶
func Vec2Rotate ¶
func Vec2Rotate180 ¶
func Vec2Rotate270 ¶
func Vec2Rotate90 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.