common

package
v0.0.0-...-b569211 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LITTLE_LETTERS = 36
	FULL_LETTERS   = 62
)

Variables

This section is empty.

Functions

func AbsInt

func AbsInt(v int) int

func AbsInt32

func AbsInt32(v int32) int32

func AbsInt64

func AbsInt64(v int64) int64

func ArrayContainInt

func ArrayContainInt(a []int, f int) bool

func ArrayContainString

func ArrayContainString(a []string, f string) bool

func CompressData

func CompressData(src []byte) []byte

func CrashLog

func CrashLog()

func DeCompressData

func DeCompressData(src []byte) ([]byte, error)

func DumpStacks

func DumpStacks() string

func Elapsed

func Elapsed(f func(d time.Duration)) func()

func GetDataDir

func GetDataDir() string

func GetEngineDir

func GetEngineDir() string

func GetMd5String

func GetMd5String(s string) string

func GetNodeDir

func GetNodeDir() string

func GetNowUpdateInSecond

func GetNowUpdateInSecond() time.Time

func GetOutboundIP

func GetOutboundIP() (net.IP, error)

func GetSrcDir

func GetSrcDir() string

func Guid

func Guid() string

func HIINT16

func HIINT16(I int32) int16

func HIINT32

func HIINT32(I int64) int32

func HashString

func HashString(s string) uint32

func Hex2Num

func Hex2Num(str string, n int) int

func Ini

func Ini()

引擎全局的初始化 如:引擎各个目录的实际地址 如:执行引擎初始化脚本 如:解压引擎数据文件 其他各个模块的初始化代码放到各自模块init中

func Int32ArrayToString

func Int32ArrayToString(a []int32, delim string) string

func Int64ArrayToString

func Int64ArrayToString(a []int64, delim string) string

func IntArrayToString

func IntArrayToString(a []int, delim string) string

func IsInt

func IsInt(r float64) bool

func LOINT16

func LOINT16(l int32) int16

func LOINT32

func LOINT32(l int64) int32

func LoadJson

func LoadJson(filename string, conf interface{}) error

func MAKEINT32

func MAKEINT32(high int16, low int16) int32

func MAKEINT64

func MAKEINT64(high int32, low int32) int64

func MaxOfInt

func MaxOfInt(vars ...int) int

func MaxOfInt64

func MaxOfInt64(vars ...int64) int64

func MinOfInt

func MinOfInt(vars ...int) int

func MinOfInt64

func MinOfInt64(vars ...int64) int64

func NumToHex

func NumToHex(num, n int) string

func RandInt

func RandInt() int32

func RandInt31n

func RandInt31n(n int) int32

func RandStr

func RandStr(l int) string

func Rc4

func Rc4(key string, src []byte) ([]byte, error)

func SafeDivide

func SafeDivide(a int64, b int64) int64

func SaveJson

func SaveJson(filename string, conf interface{}) error

func Shuffle

func Shuffle(n int, swap func(i, j int))

func StructToTable

func StructToTable(v interface{}) string

func UniqueId

func UniqueId() string

func WrapString

func WrapString(s string, n int) string

Types

type EngineConfiguration

type EngineConfiguration struct {
	Extract []string
	Init    []string
}

type StrTable

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

func (*StrTable) AddHeader

func (s *StrTable) AddHeader(h string)

func (*StrTable) AddLine

func (s *StrTable) AddLine(l StrTableLine)

func (*StrTable) FromStruct

func (s *StrTable) FromStruct(v interface{}, use func(name string) bool)

func (*StrTable) String

func (s *StrTable) String(prefix string) string

type StrTableLine

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

func (*StrTableLine) AddData

func (s *StrTableLine) AddData(d string)

func (*StrTableLine) FromStruct

func (s *StrTableLine) FromStruct(st *StrTable, v interface{}, trans func(name string, v interface{}) interface{})

Jump to

Keyboard shortcuts

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