et

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const CLOCK_ABSOLUTE_FORMAT_DATE string = "0000-00-00 00:00:00"
View Source
const CLOCK_ABSOLUTE_FORMAT_WEEK string = "0 00:00:00"
View Source
const CLOCK_ACTION_TYPE_CALLBACK string = "callback"
View Source
const CLOCK_ACTION_TYPE_CMD string = "cmd"
View Source
const CLOCK_ACTION_TYPE_URL string = "url"
View Source
const CLOCK_CHECK_RESULT_REMOVE int = 2
View Source
const CLOCK_CHECK_RESULT_RUN int = 1
View Source
const CLOCK_CHECK_RESULT_SLEEP int = 0
View Source
const CLOCK_ENTITY_HTTP_TIMEOUT int = 30 * 1000
View Source
const CLOCK_FIELD_ABSOLUTE_FORMAT string = "AbsoluteFormat"
View Source
const CLOCK_FIELD_ABSOLUTE_MAP string = "AbsoluteMap"
View Source
const CLOCK_FIELD_ABSOLUTE_MIN_SPAN string = "AbsoluteMinSpan"
View Source
const CLOCK_FIELD_ABSOLUTE_PERIOD string = "AbsolutePeriod"
View Source
const CLOCK_FIELD_ACTION_CONTENT string = "ActionContent"
View Source
const CLOCK_FIELD_ACTION_TYPE string = "ActionType"
View Source
const CLOCK_FIELD_CALLBACK_IMPL string = "CallbackImpl"
View Source
const CLOCK_FIELD_CURRENT_COUNT string = "CurrentCount"
View Source
const CLOCK_FIELD_EVENT_NAME string = "EventName"
View Source
const CLOCK_FIELD_FIRST_DELAY string = "FirstDelay"
View Source
const CLOCK_FIELD_INTERVAL string = "Interval"
View Source
const CLOCK_FIELD_LAST_TIME string = "LastTime"
View Source
const CLOCK_FIELD_MAX_COUNT string = "MaxCount"
View Source
const CLOCK_FIELD_PARAM_OBJECT string = "ParamObject"
View Source
const CLOCK_FIELD_SETUP_TIME string = "SetupTime"
View Source
const CLOCK_FIELD_TIME_TYPE string = "TimeType"
View Source
const CLOCK_FIELD_TO_RUN_IN_THE_SAME_THREAD string = "ToRunInTheSameThread"
View Source
const CLOCK_MANAGER_INTERVAL int64 = 100
View Source
const CLOCK_TIME_TYPE_ABSOLUTE string = "absolute"
View Source
const CLOCK_TIME_TYPE_INTERVAL string = "interval"
View Source
const COMMON_NOT_FOUND = -1
View Source
const DATA_HOLDER_TYPE_BOOL string = "bool"
View Source
const DATA_HOLDER_TYPE_BUF string = "buf"
View Source
const DATA_HOLDER_TYPE_FLOAT string = "float"
View Source
const DATA_HOLDER_TYPE_INT string = "int"
View Source
const DATA_HOLDER_TYPE_LONG string = "int64"
View Source
const DATA_HOLDER_TYPE_MIXED string = "mixed"
View Source
const DATA_HOLDER_TYPE_NONE string = "empty"
View Source
const DATA_HOLDER_TYPE_OBJ string = "obj"
View Source
const DATA_HOLDER_TYPE_STR string = "str"
View Source
const FILE_COPY_ACTION_OVERWRITE_EXISTED = "ovewrite_existed"
View Source
const FILE_COPY_ACTION_SKIP_EXISTED = "skip_existed"
View Source
const FILE_PERM_DEFAULT = 0755
View Source
const FILE_TEMP_BUF_DEFAULT = 4096
View Source
const FLOAT_COMPARE_DIFF = 0.00001
View Source
const JSON_CH_B_SLASH byte = '\\'
View Source
const JSON_CH_COLON byte = ':'
View Source
const JSON_CH_COMMA byte = ','
View Source
const JSON_CH_D_QUOTE byte = '"'
View Source
const JSON_CH_L_B_L byte = '{'
View Source
const JSON_CH_L_B_R byte = '}'
View Source
const JSON_CH_M_B_L byte = '['
View Source
const JSON_CH_M_B_R byte = ']'
View Source
const JSON_CH_SPACE byte = ' '
View Source
const JSON_ET_TYPE_NAME string = "et.JsonVal"
View Source
const JSON_INDENT_SIZE int = 2
View Source
const JSON_STR_B_SLASH string = "\\"
View Source
const JSON_STR_COLON string = ":"
View Source
const JSON_STR_COMMA string = ","
View Source
const JSON_STR_D_QUOTE string = "\""
View Source
const JSON_STR_FALSE string = "false"
View Source
const JSON_STR_LINE string = "\r\n"
View Source
const JSON_STR_L_B_L string = "{"
View Source
const JSON_STR_L_B_R string = "}"
View Source
const JSON_STR_M_B_L string = "["
View Source
const JSON_STR_M_B_R string = "]"
View Source
const JSON_STR_NULL string = "null"
View Source
const JSON_STR_SPACE string = " "
View Source
const JSON_STR_TRUE string = "true"
View Source
const JSON_TYPE_ARRAY int = 5
View Source
const JSON_TYPE_BOOL int = 3
View Source
const JSON_TYPE_NONE int = 0
View Source
const JSON_TYPE_NULL int = 4
View Source
const JSON_TYPE_NUM int = 2
View Source
const JSON_TYPE_OBJECT int = 6
View Source
const JSON_TYPE_TEXT int = 1
View Source
const OS_DARWIN = "darwin"
View Source
const OS_LINUX = "linux"
View Source
const OS_WINDOWS = "windows"
View Source
const REGEX_CHINESE_RULE = "^[\\u4e00-\\u9fa5]*$"

中文验证

View Source
const REGEX_EMAIL_RULE = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"

邮箱规则

View Source
const REGEX_MOBILE_PHONE_RULE = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,1,2,3,5-9])|(17[0-9]))\\d{8}$"

手机号规则(进阶)

View Source
const REGEX_MULTI_PHONE_RULE = "^1[34578][0-9]{9}(,1[34578][0-9]{9})*$"

多手机号规则,逗号相隔

View Source
const REGEX_NUM_OR_LETTER_RULE = "^[0-9a-zA-Z]*$"

验证是数字和字母含大小写

View Source
const REGEX_NUM_RULE = "^[0-9]*$"

纯数字验证

View Source
const REGEX_PASSWORD_RULE = "^[0-9a-zA-Z](?=.*\\d.*)(?=.*[a-zA-Z].*)(?!.*\\s.*).[A-Za-z0-9]{6,20}$"

密码验证,6-20位、由数字与字母构成、至少包含一位数字和一位字母、不可带空格

View Source
const REGEX_PHONE_RULE = "^1[3456789]\\d{9}$"

手机号规则

View Source
const REGEX_QQ_RULE = "[1-9][0-9]{4,14}"

多手机号规则,逗号相隔

View Source
const REGEX_TEL_RULE = "^[1-9]{1}[0-9]{5,8}$"

固话验证

View Source
const REGEX_TEL_ZONE_RULE = "^[0][1-9][0-9]{1,2}-[0-9]{5,10}$"

固话验证带区号

View Source
const REGEX_THREE_NUMERIC_RULE = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,3})?$"

包含三位小数

View Source
const STR_BLANK_CH string = " \r\n\t"
View Source
const STR_HEX_CHAR_LOWER string = "0123456789abcdef"
View Source
const STR_HEX_CHAR_UPPER string = "0123456789ABCDEF"
View Source
const TIME_FORMAT_DAY string = "d"
View Source
const TIME_FORMAT_HOUR string = "h"
View Source
const TIME_FORMAT_MILLI string = "l"
View Source
const TIME_FORMAT_MINUTE string = "i"
View Source
const TIME_FORMAT_MONTH string = "m"
View Source
const TIME_FORMAT_PREFIX string = "%"

* 本工具包内时间的各个字段的字母标识

View Source
const TIME_FORMAT_SECOND string = "s"
View Source
const TIME_FORMAT_WEEK string = "w"
View Source
const TIME_FORMAT_YEAR string = "y"

Variables

View Source
var ClockManagerStatic = struct {
	DefaultInstance *ClockManager
}{
	DefaultInstance: nil,
}
View Source
var FILE_BOM_UNICODE []byte = []byte{0xff, 0xfe}
View Source
var FILE_BOM_UTF8 []byte = []byte{0xef, 0xbb, 0xbf}
View Source
var Hash8Arr []string = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
	"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
	"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
	"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
	"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Functions

func ArrVoidSort

func ArrVoidSort(arrVoid []interface{}, fnCompare ArrVoidSortFn)

func ArrVoidSortSwap

func ArrVoidSortSwap(arrContainer []interface{}, iIndexLeft int, iIndexRight int)

func Base64DecStrToBuf

func Base64DecStrToBuf(strSrc string) []byte

func Base64DecStrToBufForUrl

func Base64DecStrToBufForUrl(strSrc string) []byte

func Base64DecStrToStr

func Base64DecStrToStr(strSrc string) string

func Base64DecStrToStrForUrl

func Base64DecStrToStrForUrl(strSrc string) string

func Base64EncBufToStr

func Base64EncBufToStr(bufSrc []byte) string

func Base64EncBufToStrForUrl

func Base64EncBufToStrForUrl(bufSrc []byte) string

func Base64EncStrToStr

func Base64EncStrToStr(strSrc string) string

func Base64EncStrToStrForUrl

func Base64EncStrToStrForUrl(strSrc string) string

func ByteCombineList

func ByteCombineList(arrBuf [][]byte) []byte

* 把多个字节流组合成一个

func ByteCopy

func ByteCopy(bufSrc []byte, iSrcOffset int, bufDest []byte, iDestOffset int, iSize int) int

* 把一段字节流中的一部分拷贝到另一个字节流

func ByteEqual

func ByteEqual(bufLeft []byte, iLeftOffset int, bufRight []byte, iRightOffset int, iSize int) bool

* 两段字节流是否相等

func ByteFindFrom

func ByteFindFrom(bufSrc []byte, iSrcOffset int, bufFind []byte) int

* 查找字节流中是否包含某一部分

func ByteIsEmpty

func ByteIsEmpty(bufSrc []byte) bool

* 判断一段字节流是否为空

func ByteSet

func ByteSet(bufSrc []byte, iOffset int, iSize int, byteToSet uint8) error

批量设置字节流中的值, 相当于memset

func ByteSubBytes

func ByteSubBytes(bufSrc []byte, iOffset int, iSize int) []byte

* 截取字节流中的一部分

func CastBoolToNumStr

func CastBoolToNumStr(bValue bool) string

func CastBoolToStr

func CastBoolToStr(bValue bool) string

func CastBufToStr

func CastBufToStr(bufData []byte) string

func CastErrToStr

func CastErrToStr(objErr error) string

func CastF64ToStr

func CastF64ToStr(fNum float64, iPrecision int) string

func CastI64ToStr

func CastI64ToStr(iNum int64) string

func CastIntToBool

func CastIntToBool(iNum int) bool

func CastIntToStr

func CastIntToStr(iNum int) string

func CastStrToBool

func CastStrToBool(strBool string) bool

* 把字符串转换为bool, 会识别,true,false,0,1, 其他的情况下,非空即为真

func CastStrToF64

func CastStrToF64(strNum string) float64

func CastStrToI64

func CastStrToI64(strNum string) int64

func CastStrToInt

func CastStrToInt(strNum string) int

func CastVoidToStr

func CastVoidToStr(xValue interface{}) string

* 把未知类型转化为相应的字符串 如果是结构体,会调用其String方法。 若无,则返回空字符串

func CmdExec

func CmdExec(strCmd string, arg ...string) error

* 简单的执行一个系统命令

func CmdOutput

func CmdOutput(strCmd string, arg ...string) (string, error)

* 执行一个系统命令,并获得返回值, 返回值中包含普通输出流和错误输出流中的内容

func CmdOutputState

func CmdOutputState(chState chan int, pStrError *string, pStrResult *string, strCmd string, arg ...string)

* 执行一个系统命令,并获得返回值,带一个通道,用于同步状态 返回值中包含普通输出流和错误输出流中的内容

func CmdOutputTimeout

func CmdOutputTimeout(iMIllisec int, strCmd string, arg ...string) (bool, string, error)

* 执行一个系统命令,并获得返回值,带有超时时间,以毫秒计算 返回值中包含普通输出流和错误输出流中的内容

func ExJsonArrSize

func ExJsonArrSize(pExJson *ExJsonVal) int

* 若此json为数组,得到此数组的大小

func ExJsonClear

func ExJsonClear(pExJson *ExJsonVal)

func ExJsonContains

func ExJsonContains(pExJson *ExJsonVal, strKey string) bool

* 此json节点是否包含某个键

func ExJsonFromStruct

func ExJsonFromStruct(pExJson *ExJsonVal, xStruct interface{}) error

* 把一个结构体转换为json对象

func ExJsonFromStructByFieldName

func ExJsonFromStructByFieldName(pExJson *ExJsonVal, xStruct interface{}) error

* 根据字段名而不是tag把一个结构体转化为json

func ExJsonFromStructInGroupRecur

func ExJsonFromStructInGroupRecur(groupStruct interface{}) interface{}

* 把一组struct转换为json,递归

func ExJsonFromStructInGroupToStr

func ExJsonFromStructInGroupToStr(groupStruct interface{}) string

* 把一组结构体序列化为字符串

func ExJsonGetBool

func ExJsonGetBool(pExJson *ExJsonVal, strKey string) bool

* 根据键名获得bool值

func ExJsonGetFloat

func ExJsonGetFloat(pExJson *ExJsonVal, strKey string) float64

* 根据键名获得浮点数

func ExJsonGetI64

func ExJsonGetI64(pExJson *ExJsonVal, strKey string) int64

* 根据键名获得长整型

func ExJsonGetIndexBool

func ExJsonGetIndexBool(pExJson *ExJsonVal, iIndex int) bool

* 根据索引获得布尔值

func ExJsonGetIndexFloat

func ExJsonGetIndexFloat(pExJson *ExJsonVal, iIndex int) float64

* 根据索引获得浮点数

func ExJsonGetIndexI64

func ExJsonGetIndexI64(pExJson *ExJsonVal, iIndex int) int64

* 根据索引获得长整型

func ExJsonGetIndexInt

func ExJsonGetIndexInt(pExJson *ExJsonVal, iIndex int) int

* 根据索引获得整数

func ExJsonGetInt

func ExJsonGetInt(pExJson *ExJsonVal, strKey string) int

* 根据键名获得整数

func ExJsonGetStr

func ExJsonGetStr(pExJson *ExJsonVal, strKey string) string

* 根据键名获得字符串

func ExJsonGetStrByIndex

func ExJsonGetStrByIndex(pExJson *ExJsonVal, iIndex int) string

* 根据索引获得字符串

func ExJsonIsEmpty

func ExJsonIsEmpty(pExJson *ExJsonVal) bool

* 此json是否为空,空对象或者空数组都是空的

func ExJsonMapContains

func ExJsonMapContains(pExJson *ExJsonVal, strKey string) bool

* 判断此json中是否包含某个键

func ExJsonMapKeys

func ExJsonMapKeys(pExJson *ExJsonVal) []string

* 把此json的键遍历出来,得到一个数组

func ExJsonPathGetStr

func ExJsonPathGetStr(pExJson *ExJsonVal, arrPath []string) string

* 根据jsonpath得到一个字符串,path是一个数组,依次是每个节点的键名,如果是数组索引请用[]包装数字

func ExJsonPathSetValue

func ExJsonPathSetValue(pExJson *ExJsonVal, arrPath []string, xValue interface{}) error

* 根据jsonpath设置json,path是一个数组,依次是每个节点的键名,如果是数组索引请用[]包装数字

func ExJsonRawToStr

func ExJsonRawToStr(pRawJson *JsonVal) string

* 把第三方原始类型转换为字符串

func ExJsonReadMapStr

func ExJsonReadMapStr(pExJson *ExJsonVal, mapSrc map[string]string)

* 把一个字符串map的内容的所有键遍历读到一个json中

func ExJsonReadMapVoid

func ExJsonReadMapVoid(pExJson *ExJsonVal, mapSrc map[string]interface{})

* 把一个空类型map的内容的所有键遍历读到一个json中

func ExJsonSet

func ExJsonSet(pExJson *ExJsonVal, strKey string, xValue interface{})

* 设置json的一个属性,strKey是键名

func ExJsonSetByIndex

func ExJsonSetByIndex(pExJson *ExJsonVal, iIndex int, xValue interface{})

func ExJsonSetChild

func ExJsonSetChild(pExJson *ExJsonVal, strKey string, pExJsonChild *ExJsonVal)

func ExJsonSetChildByIndex

func ExJsonSetChildByIndex(pExJson *ExJsonVal, iIndex int, pExJsonChild *ExJsonVal)

func ExJsonStructFieldToTag

func ExJsonStructFieldToTag(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error

* 给定一个结构体,把原先由字段名得到的json转换为以为tag键

func ExJsonStructFromStr

func ExJsonStructFromStr(strJson string, xObj interface{}) error

* 把字符串反序列化为结构体,利用json做转换

func ExJsonStructTagToField

func ExJsonStructTagToField(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error

* 给定一个结构体,把原先由tag得到的json转换为以字段名为键

func ExJsonStructToStr

func ExJsonStructToStr(xObj interface{}) string

* 把结构体序列化为字符串,

func ExJsonToArrMapStr

func ExJsonToArrMapStr(pExJson *ExJsonVal) []map[string]string

* 把json对象转为字符串map的数组,是一个2维对象

func ExJsonToArrMapVoid

func ExJsonToArrMapVoid(pExJson *ExJsonVal) []map[string]interface{}

* 把json对象转换为空类型map的数组,是一个2维对象

func ExJsonToArrStr

func ExJsonToArrStr(pExJson *ExJsonVal) []string

* 把json对象转换为字符串数组

func ExJsonToArrVoid

func ExJsonToArrVoid(pExJson *ExJsonVal) []interface{}

* 把json对象转化为空类型数组

func ExJsonToMapStr

func ExJsonToMapStr(pExJson *ExJsonVal) map[string]string

* 把json对象转换为字符串map

func ExJsonToMapVoid

func ExJsonToMapVoid(pExJson *ExJsonVal) map[string]interface{}

* 把json对象转换为无类型map

func ExJsonToPrettyStr

func ExJsonToPrettyStr(pExJson *ExJsonVal) string

* 把json对象格式化输出为字符串,会有良好的排版。

func ExJsonToStr

func ExJsonToStr(pExJson *ExJsonVal) string

* 把json对象转换为字符串

func ExJsonToStruct

func ExJsonToStruct(pExJson *ExJsonVal, pStruct interface{}) error

* 把json对象转换到一个已存在的结构体中

func ExJsonToStructByFieldName

func ExJsonToStructByFieldName(pExJson *ExJsonVal, pStruct interface{}) error

* 根据字段名,把json对象转换到一个结构体中

func ExJsonType

func ExJsonType(pExJson *ExJsonVal) int

* 判断此json节点的类型:空,对象,数组,文本,null,数字,

func ExJsonUnmarshal

func ExJsonUnmarshal(pExJson *ExJsonVal, strJson string) error

* 把json字符串解析到现有的son对象中,与parse的区别是,不产生新对象。

func FileAppendBuf

func FileAppendBuf(strFilePath string, bufAppend []byte) error

* 在文件后追加字节流

func FileAppendStr

func FileAppendStr(strFilePath string, strContent string) error

* 在文件后追加字符串

func FileBrowseDirToArrAbs

func FileBrowseDirToArrAbs(strDir string) []string

* 把目录下的文件或目录读到一个数组,此数组内的元素都是绝对路径,如果是子目录,则会在后面加上/ will add a slash to every dir

func FileBrowseDirToArrAbsRecur

func FileBrowseDirToArrAbsRecur(strDir string, arrAbs []string)

* 把目录下的文件或目录读到一个数组,遍历所有子目录,如果是子目录,则会在后面加上/ will add a slash to every dir

func FileBrowseDirToArrName

func FileBrowseDirToArrName(strDir string) []string

* 把目录下的文件或目录读到一个数组,如果是子目录,则会在后面加上/ will add a slash to every dir

func FileClearSubDir

func FileClearSubDir(strDir string) error

* 清空一个目录

func FileCopyBytes

func FileCopyBytes(strSrcPath string, strDestPath string) error

* 拷贝文件

func FileCopyDir

func FileCopyDir(strDirSrc string, strDirDest string, strCopyAction string) error

* 拷贝整个目录

func FileCopyDirOneLevel

func FileCopyDirOneLevel(strDirSrc string, strDirDest string, strCopyAction string) error

* 仅仅拷贝单层目录

func FileCopyDirRecur

func FileCopyDirRecur(strDirSrc string, strDirDest string, strCopyAction string) error

func FileGetUnicodeBom

func FileGetUnicodeBom() []byte

func FileGetUtfBom

func FileGetUtfBom() []byte

func FileIsAvailable

func FileIsAvailable(strFilePath string) bool

* 文件是否可读

func FileMakeDirAll

func FileMakeDirAll(strDir string) error

* 创建目录,会创建多级目录

func FilePathDelete

func FilePathDelete(strPath string) error

* 删除一个路径

func FileReadBuf

func FileReadBuf(strFilePath string) []byte

* 把文件内容读取为字节流

func FileReadLinesToArr

func FileReadLinesToArr(strFilePath string) []string

* 把文件按行读取到字符串数组

func FileReadPart

func FileReadPart(strPath string, iFileOffset int64, iLen int, bufDest []byte, iBufOffset int) error

* 分段读取文件

func FileReadStr

func FileReadStr(strFilePath string) string

* 把文件内容读取为字符串

func FileRemoveDir

func FileRemoveDir(strDir string) error

* 移除一个目录

func FileRemoveFile

func FileRemoveFile(strDir string) error

* 移除一个文件

func FileSetSize

func FileSetSize(strPath string, iOffset int64) error

* 设置文件大小

func FileSize

func FileSize(strFilePath string) int64

* 文件大小

func FileWriteBuf

func FileWriteBuf(strFilePath string, bufContent []byte) error

* 把字节流写入文件

func FileWritePart

func FileWritePart(strPath string, iFileOffset int64, bufToWrite []byte) error

* 分段写入文件

func FileWriteStr

func FileWriteStr(strFilePath string, strContent string) error

* 把字符串写入文件

func FloatEqual

func FloatEqual(numLeft float64, numRight float64) bool

* 两个浮点数是否相等,判断误差是否在可接受范围内

func Hash8Convert10To62

func Hash8Convert10To62(strNum10 string) string

func Hash8Convert62to10

func Hash8Convert62to10(strNum10 string) string

func Hash8Encode

func Hash8Encode(strSrc string) string

func HttpClientGetBuf

func HttpClientGetBuf(strUrl string, iTimeoutMilli int, mapHeader map[string]string) ([]byte, error)

* 用get得到字节流,一般是下载

func HttpClientGetResp

func HttpClientGetResp(strUrl string, iTimeoutMilli int, mapHeader map[string]string) (*http.Response, error)

* 用get得到一个response响应对象

func HttpClientGetRespWithRedirect

func HttpClientGetRespWithRedirect(strUrl string, iTimeoutMilli int, mapHeader map[string]string, toRedirect bool, redirectHeader bool) (*http.Response, int, error)

* 用get得到一个响应对象,需要设置是否跟随302,病情是否需要转发原始头

func HttpClientGetStr

func HttpClientGetStr(strUrl string, iTimeoutMilli int, mapHeader map[string]string) string

* 用get得到字符串

func HttpClientPostBuf

func HttpClientPostBuf(strUrl string, bufRequest []byte, iTimeoutMilli int, mapHeader map[string]string) ([]byte, error)

* 用post得到字节流

func HttpClientPostStr

func HttpClientPostStr(strUrl string, strPostData string, iTimeoutMilli int, mapHeader map[string]string) string

* 用post得到字符串

func HttpsClientGetBuf

func HttpsClientGetBuf(strUrl string, iTimeoutMilli int, mapHeader map[string]string) ([]byte, error)

func HttpsClientGetStr

func HttpsClientGetStr(strUrl string, iTimeoutMilli int, mapHeader map[string]string) string

* https操作类,一般不需要用,因为go http内置工具会在底层判断https。

func JsonArrAppendFloat

func JsonArrAppendFloat(pJson *JsonVal, fValue float64)

func JsonArrAppendI64

func JsonArrAppendI64(pJson *JsonVal, iValue int64)

func JsonArrAppendInt

func JsonArrAppendInt(pJson *JsonVal, iValue int)

func JsonArrAppendJson

func JsonArrAppendJson(pJson *JsonVal, pChildJson *JsonVal)

func JsonArrAppendNull

func JsonArrAppendNull(pJson *JsonVal)

func JsonArrAppendNum

func JsonArrAppendNum(pJson *JsonVal, numValue interface{})

func JsonArrAppendText

func JsonArrAppendText(pJson *JsonVal, strText string)

func JsonArrClear

func JsonArrClear(pJson *JsonVal)

func JsonArrFillBlank

func JsonArrFillBlank(pJson *JsonVal, iMaxIndex int)

func JsonArrGetBool

func JsonArrGetBool(pJson *JsonVal, iIndex int) bool

func JsonArrGetFloat

func JsonArrGetFloat(pJson *JsonVal, iIndex int) float64

func JsonArrGetI64

func JsonArrGetI64(pJson *JsonVal, iIndex int) int64

func JsonArrGetInt

func JsonArrGetInt(pJson *JsonVal, iIndex int) int

func JsonArrGetStr

func JsonArrGetStr(pJson *JsonVal, iIndex int) string

func JsonArrGetVoid

func JsonArrGetVoid(pJson *JsonVal, iIndex int) interface{}

func JsonArrRemoveIndex

func JsonArrRemoveIndex(pJson *JsonVal, iIndex int)

func JsonArrSetBool

func JsonArrSetBool(pJson *JsonVal, iIndex int, bValue bool)

func JsonArrSetFloat

func JsonArrSetFloat(pJson *JsonVal, iIndex int, fValue float64)

func JsonArrSetI64

func JsonArrSetI64(pJson *JsonVal, iIndex int, iValue int64)

func JsonArrSetInt

func JsonArrSetInt(pJson *JsonVal, iIndex int, iValue int)

func JsonArrSetJson

func JsonArrSetJson(pJson *JsonVal, iIndex int, pChildJson *JsonVal)

func JsonArrSetNull

func JsonArrSetNull(pJson *JsonVal, iIndex int)

func JsonArrSetNum

func JsonArrSetNum(pJson *JsonVal, iIndex int, xValue interface{})

func JsonArrSetText

func JsonArrSetText(pJson *JsonVal, iIndex int, strText string)

func JsonArrSetVoid

func JsonArrSetVoid(pJson *JsonVal, iIndex int, xValue interface{})

func JsonIsArray

func JsonIsArray(pJson *JsonVal) bool

func JsonIsCollection

func JsonIsCollection(pJson *JsonVal) bool

func JsonIsEmpty

func JsonIsEmpty(pJson *JsonVal) bool

func JsonIsObject

func JsonIsObject(pJson *JsonVal) bool

func JsonLen

func JsonLen(pJson *JsonVal) int

func JsonMarshal

func JsonMarshal(xObj interface{}) string

func JsonObjClear

func JsonObjClear(pJson *JsonVal)

func JsonObjContainsKey

func JsonObjContainsKey(pJson *JsonVal, strKey string) bool

func JsonObjGetBool

func JsonObjGetBool(pJson *JsonVal, strKey string) bool

func JsonObjGetFloat

func JsonObjGetFloat(pJson *JsonVal, strKey string) float64

func JsonObjGetI64

func JsonObjGetI64(pJson *JsonVal, strKey string) int64

func JsonObjGetInt

func JsonObjGetInt(pJson *JsonVal, strKey string) int

func JsonObjGetStr

func JsonObjGetStr(pJson *JsonVal, strKey string) string

func JsonObjGetVoid

func JsonObjGetVoid(pJson *JsonVal, strKey string) interface{}

func JsonObjKeys

func JsonObjKeys(pJson *JsonVal) []string

func JsonObjRemoveKey

func JsonObjRemoveKey(pJson *JsonVal, strKey string)

func JsonObjSetBool

func JsonObjSetBool(pJson *JsonVal, strKey string, bBool bool)

func JsonObjSetFloat

func JsonObjSetFloat(pJson *JsonVal, strKey string, fValue float64)

func JsonObjSetI64

func JsonObjSetI64(pJson *JsonVal, strKey string, iValue int64)

func JsonObjSetInt

func JsonObjSetInt(pJson *JsonVal, strKey string, iValue int)

func JsonObjSetJson

func JsonObjSetJson(pJson *JsonVal, strKey string, pChildJson *JsonVal)

func JsonObjSetNull

func JsonObjSetNull(pJson *JsonVal, strKey string)

func JsonObjSetNum

func JsonObjSetNum(pJson *JsonVal, strKey string, xValue interface{})

func JsonObjSetText

func JsonObjSetText(pJson *JsonVal, strKey string, strText string)

func JsonObjSetVoid

func JsonObjSetVoid(pJson *JsonVal, strKey string, xValue interface{})

func JsonParserParseByPos

func JsonParserParseByPos(pParser *JsonParser) int

func JsonParserStackPop

func JsonParserStackPop(pParser *JsonParser)

func JsonParserStackPush

func JsonParserStackPush(pParser *JsonParser, jsonNew *JsonVal)

func JsonRefresh

func JsonRefresh(pJson *JsonVal, strSrc string) error

func JsonToArrJsonAsVoid

func JsonToArrJsonAsVoid(pJson *JsonVal) []interface{}

func JsonToArrMapStr

func JsonToArrMapStr(pJson *JsonVal) []map[string]string

func JsonToArrMapVoid

func JsonToArrMapVoid(pJson *JsonVal) []map[string]interface{}

func JsonToArrStr

func JsonToArrStr(pJson *JsonVal) []string

func JsonToArrVoid

func JsonToArrVoid(pJson *JsonVal) []interface{}

func JsonToFormattedStr

func JsonToFormattedStr(pJson *JsonVal) string

func JsonToFormattedStrByLevel

func JsonToFormattedStrByLevel(pJson *JsonVal, iLevel int) string

func JsonToMapJson

func JsonToMapJson(pJson *JsonVal) map[string]*JsonVal

func JsonToMapJsonAsVoid

func JsonToMapJsonAsVoid(pJson *JsonVal) map[string]interface{}

func JsonToMapStr

func JsonToMapStr(pJson *JsonVal) map[string]string

func JsonToMapVoid

func JsonToMapVoid(pJson *JsonVal) map[string]interface{}

func JsonToStr

func JsonToStr(pJson *JsonVal) string

func JsonType

func JsonType(pJson *JsonVal) int

func JsonUnmarshal

func JsonUnmarshal(strJson string, xObj interface{}) error

func ListBack

func ListBack(pList *list.List) interface{}

func ListClear

func ListClear(pList *list.List)

func ListContains

func ListContains(pList *list.List, pValue interface{}) bool

func ListCreate

func ListCreate() *list.List

func ListFront

func ListFront(pList *list.List) interface{}

func ListLen

func ListLen(pList *list.List) int

func ListPeekBack

func ListPeekBack(pList *list.List) interface{}

func ListPeekFront

func ListPeekFront(pList *list.List) interface{}

func ListPopBack

func ListPopBack(pList *list.List) interface{}

func ListPopFront

func ListPopFront(pList *list.List) interface{}

func ListPushBack

func ListPushBack(pList *list.List, pValue interface{}) bool

func ListPushFront

func ListPushFront(pList *list.List, pValue interface{}) bool

func ListRemove

func ListRemove(pList *list.List, pValue interface{}) bool

func ListWalk

func ListWalk(pList *list.List, fnWalk ListWalkFn) int

func MapStrClone

func MapStrClone(mapSrc map[string]string) map[string]string

* 克隆一个map str

func MapStrContains

func MapStrContains(mapSrc map[string]string, strKey string) bool

* 是否包含相应的键

func MapStrGetBool

func MapStrGetBool(mapSrc map[string]string, strKey string) bool

* 根据键名获得布尔型

func MapStrGetFloat

func MapStrGetFloat(mapSrc map[string]string, strKey string) float64

* 根据键名获得浮点型

func MapStrGetInt

func MapStrGetInt(mapSrc map[string]string, strKey string) int

* 根据键名获得整数

func MapStrGetLong

func MapStrGetLong(mapSrc map[string]string, strKey string) int64

* 根据键名获得长整型

func MapStrGetStr

func MapStrGetStr(mapSrc map[string]string, strKey string) string

* 根据键名获得字符串

func MapStrSet

func MapStrSet(mapSrc map[string]string, mapDest map[string]string) int

* 把一个map str的所有键设置给另一个map str

func MapStrToUrlStr

func MapStrToUrlStr(mapVoid map[string]string) string

* 把map str转换为一个url字符串

func MapVoidContains

func MapVoidContains(mapSrc map[string]interface{}, strKey string) bool

* 是否包含相应的键

func MapVoidGetBool

func MapVoidGetBool(mapSrc map[string]interface{}, strKey string) bool

* 根据键名获得布尔型

func MapVoidGetFloat

func MapVoidGetFloat(mapSrc map[string]interface{}, strKey string) float64

* 根据键名获得浮点型

func MapVoidGetInt

func MapVoidGetInt(mapSrc map[string]interface{}, strKey string) int

* 根据键名获得数值

func MapVoidGetLong

func MapVoidGetLong(mapSrc map[string]interface{}, strKey string) int64

* 根据键名获得长整型

func MapVoidGetStr

func MapVoidGetStr(mapSrc map[string]interface{}, strKey string) string

* 根据键名获得字符串

func MapVoidGetVoid

func MapVoidGetVoid(mapSrc map[string]interface{}, strKey string) interface{}

* 根据键名获得interface

func MapVoidToMapStr

func MapVoidToMapStr(mapVoid map[string]interface{}) map[string]string

* 把map void 转换为map str

func MapVoidToUrlStr

func MapVoidToUrlStr(mapVoid map[string]interface{}) string

* 把map void转换为一个url字符串

func Md5ToLower32

func Md5ToLower32(strSrc string) string

* 获得小写32位的md5

func OsEnvVar

func OsEnvVar(strKey string) string

func OsName

func OsName() string

func ProcessCurrentId

func ProcessCurrentId() int

func ProcessParentId

func ProcessParentId() int

func ReflectCallForStrByStr

func ReflectCallForStrByStr(pObj interface{}, strMethodName string, strParam string) string

* 根据名称执行对象的方法,参数是一个字符串,返回值也是一个字符串

func SpJsonArrSize

func SpJsonArrSize(jsonSp *simplejson.Json) int

func SpJsonContains

func SpJsonContains(jsonSp *simplejson.Json, strKey string) bool

func SpJsonFromBuf

func SpJsonFromBuf(bufJson []byte) *simplejson.Json

func SpJsonFromStr

func SpJsonFromStr(strJson string) *simplejson.Json

func SpJsonFromStruct

func SpJsonFromStruct(jsonSp *simplejson.Json, stObj interface{}) error

func SpJsonFromStructByFieldName

func SpJsonFromStructByFieldName(jsonSp *simplejson.Json, xStruct interface{}) error

func SpJsonFromStructInGroup

func SpJsonFromStructInGroup(groupStruct interface{}) *simplejson.Json

func SpJsonFromStructInGroupRecur

func SpJsonFromStructInGroupRecur(groupStruct interface{}) interface{}

func SpJsonFromStructInGroupToStr

func SpJsonFromStructInGroupToStr(groupStruct interface{}) string

func SpJsonFromStructNew

func SpJsonFromStructNew(stObj interface{}) *simplejson.Json

func SpJsonGetBool

func SpJsonGetBool(jsonSp *simplejson.Json, strKey string) bool

func SpJsonGetChild

func SpJsonGetChild(jsonSp *simplejson.Json, strKey string) *simplejson.Json

func SpJsonGetFloat

func SpJsonGetFloat(jsonSp *simplejson.Json, strKey string) float64

func SpJsonGetI64

func SpJsonGetI64(jsonSp *simplejson.Json, strKey string) int64

func SpJsonGetIndexBool

func SpJsonGetIndexBool(jsonSp *simplejson.Json, iIndex int) bool

func SpJsonGetIndexChild

func SpJsonGetIndexChild(jsonSp *simplejson.Json, iIndex int) *simplejson.Json

func SpJsonGetIndexFloat

func SpJsonGetIndexFloat(jsonSp *simplejson.Json, iIndex int) float64

func SpJsonGetIndexI64

func SpJsonGetIndexI64(jsonSp *simplejson.Json, iIndex int) int64

func SpJsonGetIndexInt

func SpJsonGetIndexInt(jsonSp *simplejson.Json, iIndex int) int

func SpJsonGetIndexStr

func SpJsonGetIndexStr(jsonSp *simplejson.Json, iIndex int) string

func SpJsonGetInt

func SpJsonGetInt(jsonSp *simplejson.Json, strKey string) int

func SpJsonGetStr

func SpJsonGetStr(jsonSp *simplejson.Json, strKey string) string

func SpJsonIsEmpty

func SpJsonIsEmpty(jsonSp *simplejson.Json) bool

func SpJsonMapContains

func SpJsonMapContains(jsonSp *simplejson.Json, strKey string) bool

func SpJsonMapKeys

func SpJsonMapKeys(jsonSp *simplejson.Json) []string

func SpJsonPathGetStr

func SpJsonPathGetStr(jsonSp *simplejson.Json, strPath string) string

func SpJsonPathSetValue

func SpJsonPathSetValue(jsonSp *simplejson.Json, strPath string, xValue interface{}) error

func SpJsonReadMapStr

func SpJsonReadMapStr(jsonSp *simplejson.Json, mapSrc map[string]string)

func SpJsonReadMapVoid

func SpJsonReadMapVoid(jsonSp *simplejson.Json, mapSrc map[string]interface{})

func SpJsonStructFieldToTag

func SpJsonStructFieldToTag(jsonSpSrc *simplejson.Json, xStruct interface{}, jsonSpDest *simplejson.Json) error

func SpJsonStructFromStr

func SpJsonStructFromStr(strJson string, xObj interface{}) error

func SpJsonStructTagToField

func SpJsonStructTagToField(jsonSpSrc *simplejson.Json, xStruct interface{}, jsonSpDest *simplejson.Json) error

func SpJsonStructToStr

func SpJsonStructToStr(xObj interface{}) string

func SpJsonToArrMapStr

func SpJsonToArrMapStr(jsonArr *simplejson.Json) []map[string]string

func SpJsonToArrMapVoid

func SpJsonToArrMapVoid(jsonArr *simplejson.Json) []map[string]interface{}

func SpJsonToArrStr

func SpJsonToArrStr(jsonSp *simplejson.Json) []string

func SpJsonToArrVoid

func SpJsonToArrVoid(jsonSp *simplejson.Json) []interface{}

func SpJsonToMapStr

func SpJsonToMapStr(jsonSp *simplejson.Json) map[string]string

func SpJsonToMapVoid

func SpJsonToMapVoid(jsonSp *simplejson.Json) map[string]interface{}

func SpJsonToPrettyStr

func SpJsonToPrettyStr(jsonSp *simplejson.Json) string

func SpJsonToStr

func SpJsonToStr(jsonSp *simplejson.Json) string

func SpJsonToStruct

func SpJsonToStruct(jsonSp *simplejson.Json, stObj interface{}) error

func SpJsonToStructByFieldName

func SpJsonToStructByFieldName(jsonSp *simplejson.Json, xStruct interface{}) error

func SpJsonType

func SpJsonType(jsonSp *simplejson.Json) int

func StrAddSlashes

func StrAddSlashes(strSrc string, chSpecial uint8) string

* 给某字符加入反斜杠

func StrByteFromHex

func StrByteFromHex(strHex string) uint8

* 把16进制字符串转换为一个字节

func StrByteToHex

func StrByteToHex(bySrc uint8) string

* 把单个字节转换为16进制字符串

func StrCapitalize

func StrCapitalize(strSrc string) string

* 把首字母转为大写

func StrDecodeUriComponent

func StrDecodeUriComponent(strSrc string) string

* decodeuri,反转义url字符串

func StrEncodeUriComponent

func StrEncodeUriComponent(strSrc string) string

* encodeuri,转义url字符串

func StrFindChars

func StrFindChars(strSrc string, strChars string, iFromPos int) int

* 只要strSrc中出现strChars中的任意一个字符,则返回出现的位置

func StrFindFirstNonBlank

func StrFindFirstNonBlank(strSrc string, iFromPos int) int

* 找到第一个非空字符串

func StrFindFirstWithoutSlash

func StrFindFirstWithoutSlash(strSrc string, chToFind uint8, iFromPos int) int

* 找到第一个某字符,前面不是反斜杠的,也就是非专业

func StrFindFrom

func StrFindFrom(strSrc string, strFind string, iFromPos int) int

func StrFindLastNonBlank

func StrFindLastNonBlank(strSrc string) int

* 找到最后一个非空字符

func StrHexFromBuf

func StrHexFromBuf(bufSrc []byte) string

* 把字节流转换为16进制

func StrHexToBuf

func StrHexToBuf(strHex string) []byte

* 把16进制转换为字节流

func StrIsDec

func StrIsDec(strSrc string) bool

is it a decimal number

func StrIsInt

func StrIsInt(strSrc string) bool

* 是否为整型

func StrIsNum

func StrIsNum(strSrc string) bool

* 是否为数字

func StrIsSciNum

func StrIsSciNum(strNumLeft, strNumRight string) bool

is it a scientific number?

func StrIsWithIn

func StrIsWithIn(strSrc string, strCollection string) bool

* 判断字符串的内容是否都限于某些字符

func StrPadLeft

func StrPadLeft(strSrc string, strPad string, iTotalCount int) string

* 在字符串的左边补齐字符

func StrPadRight

func StrPadRight(strSrc string, strPad string, iTotalCount int) string

* 在字符串右边补齐字符

func StrRemoveStrEnds

func StrRemoveStrEnds(strSrc string, strOnEnds string) string

* 删除两端的字符串。比如两端的引号。

func StrStripSlashes

func StrStripSlashes(strSrc string) string

* 给某字符加入反斜杠后,反复原

func StrXsvFromMap

func StrXsvFromMap(mapXsv map[string]string, strSplit1 string, strSplit2 string) string

* 把一个字符MAP序列化为xsv,分隔符是split1,和split2

func StrXsvToMap

func StrXsvToMap(strXsv string, strSplit1 string, strSplit2 string) map[string]string

* 把一个字符串按两种切割符号切两轮,形成一个字符map,比如&与= Xsv的含义是Csv,只是不一定是用逗号

func StructDeepClone

func StructDeepClone(pSrc interface{}) interface{}

* 结构体克隆,会产生新对象

func StructDeepCopy

func StructDeepCopy(pSrc interface{}, pDest interface{}) error

* 单个结构体深度复制

func StructInGroupDeepClone

func StructInGroupDeepClone(groupStruct interface{}) interface{}

* 结构体数组或者MAP深度复制

func StructToMapVoid

func StructToMapVoid(xStruct interface{}, strTag string) map[string]interface{}

* 把结构体转换为一个map

func TimeFormatNowToStr

func TimeFormatNowToStr(strFormat string) string

* 把当前的时间格式化为字符串

func TimeFormatObjToMap

func TimeFormatObjToMap(objTime time.Time) map[string]int

* 把时间格式化为一个map,键名就是各个字母标识,定义在常量中

func TimeFormatObjToStr

func TimeFormatObjToStr(strFormat string, objTime time.Time) string

* 把时间对象格式化为字符串,格式中的%x 会被替换为实际的时间值,比如%y是年,%m是月

func TimeFormatStamp13ToMap

func TimeFormatStamp13ToMap(iStamp13 int64) map[string]int

* 把13位时间戳转换为map

func TimeFormatStamp13ToStr

func TimeFormatStamp13ToStr(strFormat string, iStamp13 int64) string

* 根据13为时间戳格式化为字符串

func TimeFormattedMapIsContained

func TimeFormattedMapIsContained(mapSmaller map[string]int, mapBigger map[string]int) bool

* 一个时间相关的map中是否包含某个键

func TimeFromStamp13

func TimeFromStamp13(iStamp13 int64) time.Time

* 由13位时间戳得到一个时间对象

func TimeGetMilli

func TimeGetMilli(xTime time.Time) int

* 得到当前毫秒数

func TimeGetStamp13

func TimeGetStamp13(xTime time.Time) int64

* 获取指定时间对象的13位时间戳

func TimeNowStamp10

func TimeNowStamp10() int64

* 得到当前的10位时间戳

func TimeNowStamp13

func TimeNowStamp13() int64

* 得到当前的13位时间戳

Types

type ArrVoidSortFn

type ArrVoidSortFn func(pLeft interface{}, pRight interface{}) int

type ClockCallback

type ClockCallback interface {
	OnTime(strEventName string, xParam interface{}, iCurrentStamp13 int64)
}

type ClockEntity

type ClockEntity struct {
	TimeType             string         `Required:"1" Enum:"interval|absolute" Remark:"定时类型 按间隔,按绝对时间"`
	ActionType           string         `Required:"1" Enum:"url|cmd|callback" Remark:"操作类型 访问URL,执行系统命令,调用回调函数"`
	EventName            string         `Required:"1" Remark:"给定时器定一个名称,确保相对唯一即可"`
	ActionContent        string         `` /* 136-byte string literal not displayed */
	MaxCount             int            `Required:"0" Remark:"最大执行次数"`
	FirstDelay           int64          `Required:"0" Remark:"要推迟多久才执行第一次"`
	Interval             int64          `Required:"0" Remark:"间隔时间"`
	AbsolutePeriod       string         `Required:"0" Remark:"绝对时间的周期,是年,月,日,时,分,秒钟的一种"`
	AbsoluteMinSpan      int64          `Required:"0" Remark:"绝对时间的最小触发间隔"`
	AbsoluteFormat       string         `` /* 135-byte string literal not displayed */
	AbsoluteMap          map[string]int `Required:"0" Remark:"解析完绝对时间格式后得到的一个表"`
	CurrentCount         int            `Required:"0" Remark:"当前已经执行的次数"`
	LastTime             int64          `Required:"0" Remark:"上次执行的时间戳"`
	SetupTime            int64          `Required:"0" Remark:"启动时间"`
	ToRunInTheSameThread bool           `` /* 139-byte string literal not displayed */
	ParamObject          interface{}    `Required:"0" Remark:"用于函数回调的情况,将被设置为函数的参数"`
	CallbackImpl         ClockCallback  `Required:"0" Remark:"被设置的回调函数"`
}

* 定时器事件实体类 一个定时管理器含有多个事件实体 一般不需要操作此类

func ClockEntityNew

func ClockEntityNew(strEventName string, strActionType string, strTimeType string) *ClockEntity

func (*ClockEntity) AnalyzeFormat

func (pThis *ClockEntity) AnalyzeFormat() error

func (*ClockEntity) CheckBeforeRun

func (pThis *ClockEntity) CheckBeforeRun(iStamp13 int64) int

func (*ClockEntity) CheckBeforeRunByAbsolute

func (pThis *ClockEntity) CheckBeforeRunByAbsolute(iStamp13 int64) int

func (*ClockEntity) CheckBeforeRunByInterval

func (pThis *ClockEntity) CheckBeforeRunByInterval(iStamp13 int64) int

func (*ClockEntity) Run

func (pThis *ClockEntity) Run(iCurrentStamp13 int64)

func (*ClockEntity) RunSync

func (pThis *ClockEntity) RunSync(iCurrentStamp13 int64)

type ClockManager

type ClockManager struct {
	Running   bool
	EntityMap map[string]*ClockEntity
	Interval  int64
	Mutex     sync.Mutex
}

func ClockManagerGetDefaultInstance

func ClockManagerGetDefaultInstance() *ClockManager

* 获得默认的系统定时管理器,建议使用此方法,而不是new

func ClockManagerNew

func ClockManagerNew() *ClockManager

* 新建一个定时器管理器 不建议一个应用内含有多个定时器, 请使用ClockManagerGetDefaultInstance()方法

func (*ClockManager) AddAbsolute

func (pThis *ClockManager) AddAbsolute(strEventName string, strActionType string, strActionContent string, implCallback ClockCallback, strAbsoluteFormat string, objParam interface{}, toRunInTheSameThread bool) error

* 按照绝对时间的模式添加一个定时事件

func (*ClockManager) AddEntity

func (pThis *ClockManager) AddEntity(pEntity *ClockEntity) error

func (*ClockManager) AddInterval

func (pThis *ClockManager) AddInterval(strEventName string, strActionType string, strActionContent string, implCallback ClockCallback, iInterval int64, iFirstDelay int64, iMaxCount int, objParam interface{}, toRunInTheSameThread bool) error

* 按照间隔的模式添加一个定时事件

func (*ClockManager) Clear

func (pThis *ClockManager) Clear()

* 清空所有定时器

func (*ClockManager) IsRunning

func (pThis *ClockManager) IsRunning() bool

func (*ClockManager) Loop

func (pThis *ClockManager) Loop()

func (*ClockManager) RemoveEntity

func (pThis *ClockManager) RemoveEntity(strEventName string) error

func (*ClockManager) SetRunning

func (pThis *ClockManager) SetRunning(bRunning bool)

func (*ClockManager) Start

func (pThis *ClockManager) Start() error

* 启动定时器

func (*ClockManager) Stop

func (pThis *ClockManager) Stop()

* 关闭定时器

type DataHolder

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

func DataHolderNew

func DataHolderNew() *DataHolder

func DataHolderNewStr

func DataHolderNewStr(strData string) *DataHolder

func (*DataHolder) GetBool

func (my *DataHolder) GetBool() bool

func (*DataHolder) GetBuf

func (my *DataHolder) GetBuf() []byte

func (*DataHolder) GetFloat

func (my *DataHolder) GetFloat() float64

func (*DataHolder) GetInt

func (my *DataHolder) GetInt() int

func (*DataHolder) GetLong

func (my *DataHolder) GetLong() int64

func (*DataHolder) GetObj

func (my *DataHolder) GetObj() interface{}

func (*DataHolder) GetStr

func (my *DataHolder) GetStr() string

func (*DataHolder) GetType

func (my *DataHolder) GetType() string

func (*DataHolder) SetBool

func (my *DataHolder) SetBool(bData bool)

func (*DataHolder) SetBuf

func (my *DataHolder) SetBuf(bufData []byte)

func (*DataHolder) SetFloat

func (my *DataHolder) SetFloat(fData float64)

func (*DataHolder) SetInt

func (my *DataHolder) SetInt(iData int)

func (*DataHolder) SetLong

func (my *DataHolder) SetLong(iLong int64)

func (*DataHolder) SetObj

func (my *DataHolder) SetObj(xData interface{})

func (*DataHolder) SetStr

func (my *DataHolder) SetStr(strData string)

func (*DataHolder) ToJsonStr

func (my *DataHolder) ToJsonStr() string

func (*DataHolder) ToStrByFormat

func (my *DataHolder) ToStrByFormat(strFormat string) string

func (*DataHolder) ToUrlStr

func (my *DataHolder) ToUrlStr() string

type ExJsonVal

type ExJsonVal JsonVal

* 隐藏第三方类型,降低框架耦合度

func ExJsonClone

func ExJsonClone(pExJson *ExJsonVal) *ExJsonVal

* 克隆一个JSON对象

func ExJsonFromBuf

func ExJsonFromBuf(bufJson []byte) *ExJsonVal

* 把字节流转化为json

func ExJsonFromStr

func ExJsonFromStr(strJson string) *ExJsonVal

* 把字符串转化为json,与parse一样

func ExJsonFromStructInGroup

func ExJsonFromStructInGroup(groupStruct interface{}) *ExJsonVal

* 把一组struct转换为json

func ExJsonFromStructNew

func ExJsonFromStructNew(xStruct interface{}) *ExJsonVal

* 根据一个结构体,创建新的json对象

func ExJsonGetChild

func ExJsonGetChild(pExJson *ExJsonVal, strKey string) *ExJsonVal

* 根据键名获得下级json节点

func ExJsonGetChildByIndex

func ExJsonGetChildByIndex(pExJson *ExJsonVal, iIndex int) *ExJsonVal

* 根据索引获得下级json

func ExJsonNewArray

func ExJsonNewArray() *ExJsonVal

* 新建一个空json对象

func ExJsonNewObject

func ExJsonNewObject() *ExJsonVal

* 新建一个空json对象

func ExJsonParse

func ExJsonParse(strText string) *ExJsonVal

* 解析字符串为json对象

func ExJsonPathGetChild

func ExJsonPathGetChild(pExJson *ExJsonVal, arrPath []string) *ExJsonVal

func ExJsonRawToPtr

func ExJsonRawToPtr(pRawJson *JsonVal) *ExJsonVal

* 把第三方原始对象转换为封装后的类型。

func ExJsonRawToVal

func ExJsonRawToVal(valRawJson JsonVal) ExJsonVal

* 把第三方原始类型的值转换为封装类型的值

func (*ExJsonVal) String

func (my *ExJsonVal) String() string

type JsonParser

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

func JsonParserNew

func JsonParserNew(strSrc string, jsonRoot *JsonVal) *JsonParser

type JsonVal

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

func ExJsonRawFromPtr

func ExJsonRawFromPtr(pExJson *ExJsonVal) *JsonVal

* 把封装类型的指针转换为第三方原始类型的指针

func ExJsonRawFromVal

func ExJsonRawFromVal(valExJson ExJsonVal) JsonVal

* 把封装类型的值转换为原始类型的值

func JsonArrGetJson

func JsonArrGetJson(pJson *JsonVal, iIndex int) *JsonVal

func JsonFromStr

func JsonFromStr(strSrc string) *JsonVal

///////////////////////////////////////////////////////////////

func JsonNewArray

func JsonNewArray() *JsonVal

func JsonNewNone

func JsonNewNone() *JsonVal

func JsonNewObject

func JsonNewObject() *JsonVal

func JsonObjGetJson

func JsonObjGetJson(pJson *JsonVal, strKey string) *JsonVal

func JsonParserResult

func JsonParserResult(pParser *JsonParser) *JsonVal

func JsonParserStackTopJson

func JsonParserStackTopJson(pParser *JsonParser) *JsonVal

func JsonToArrJson

func JsonToArrJson(pJson *JsonVal) []*JsonVal

func (JsonVal) EtTypeName

func (my JsonVal) EtTypeName() string

func (JsonVal) JsonValTag

func (my JsonVal) JsonValTag() string

func (JsonVal) String

func (my JsonVal) String() string

type ListWalkFn

type ListWalkFn func(valueOfElement interface{}) bool

* traverses the list with the function and every element @valueOfElement:value of every element @return:whether to delete this element

Jump to

Keyboard shortcuts

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