Documentation ¶
Index ¶
- Constants
- Variables
- func ArrVoidSort(arrVoid []interface{}, fnCompare ArrVoidSortFn)
- func ArrVoidSortSwap(arrContainer []interface{}, iIndexLeft int, iIndexRight int)
- func Base64DecStrToBuf(strSrc string) []byte
- func Base64DecStrToBufForUrl(strSrc string) []byte
- func Base64DecStrToStr(strSrc string) string
- func Base64DecStrToStrForUrl(strSrc string) string
- func Base64EncBufToStr(bufSrc []byte) string
- func Base64EncBufToStrForUrl(bufSrc []byte) string
- func Base64EncStrToStr(strSrc string) string
- func Base64EncStrToStrForUrl(strSrc string) string
- func ByteCombineList(arrBuf [][]byte) []byte
- func ByteCopy(bufSrc []byte, iSrcOffset int, bufDest []byte, iDestOffset int, iSize int) int
- func ByteEqual(bufLeft []byte, iLeftOffset int, bufRight []byte, iRightOffset int, iSize int) bool
- func ByteFindFrom(bufSrc []byte, iSrcOffset int, bufFind []byte) int
- func ByteIsEmpty(bufSrc []byte) bool
- func ByteSet(bufSrc []byte, iOffset int, iSize int, byteToSet uint8) error
- func ByteSubBytes(bufSrc []byte, iOffset int, iSize int) []byte
- func CastBoolToNumStr(bValue bool) string
- func CastBoolToStr(bValue bool) string
- func CastBufToStr(bufData []byte) string
- func CastErrToStr(objErr error) string
- func CastF64ToStr(fNum float64, iPrecision int) string
- func CastI64ToStr(iNum int64) string
- func CastIntToBool(iNum int) bool
- func CastIntToStr(iNum int) string
- func CastStrToBool(strBool string) bool
- func CastStrToF64(strNum string) float64
- func CastStrToI64(strNum string) int64
- func CastStrToInt(strNum string) int
- func CastVoidToStr(xValue interface{}) string
- func CmdExec(strCmd string, arg ...string) error
- func CmdOutput(strCmd string, arg ...string) (string, error)
- func CmdOutputState(chState chan int, pStrError *string, pStrResult *string, strCmd string, ...)
- func CmdOutputTimeout(iMIllisec int, strCmd string, arg ...string) (bool, string, error)
- func ExJsonArrSize(pExJson *ExJsonVal) int
- func ExJsonClear(pExJson *ExJsonVal)
- func ExJsonContains(pExJson *ExJsonVal, strKey string) bool
- func ExJsonFromStruct(pExJson *ExJsonVal, xStruct interface{}) error
- func ExJsonFromStructByFieldName(pExJson *ExJsonVal, xStruct interface{}) error
- func ExJsonFromStructInGroupRecur(groupStruct interface{}) interface{}
- func ExJsonFromStructInGroupToStr(groupStruct interface{}) string
- func ExJsonGetBool(pExJson *ExJsonVal, strKey string) bool
- func ExJsonGetFloat(pExJson *ExJsonVal, strKey string) float64
- func ExJsonGetI64(pExJson *ExJsonVal, strKey string) int64
- func ExJsonGetIndexBool(pExJson *ExJsonVal, iIndex int) bool
- func ExJsonGetIndexFloat(pExJson *ExJsonVal, iIndex int) float64
- func ExJsonGetIndexI64(pExJson *ExJsonVal, iIndex int) int64
- func ExJsonGetIndexInt(pExJson *ExJsonVal, iIndex int) int
- func ExJsonGetInt(pExJson *ExJsonVal, strKey string) int
- func ExJsonGetStr(pExJson *ExJsonVal, strKey string) string
- func ExJsonGetStrByIndex(pExJson *ExJsonVal, iIndex int) string
- func ExJsonIsEmpty(pExJson *ExJsonVal) bool
- func ExJsonMapContains(pExJson *ExJsonVal, strKey string) bool
- func ExJsonMapKeys(pExJson *ExJsonVal) []string
- func ExJsonPathGetStr(pExJson *ExJsonVal, arrPath []string) string
- func ExJsonPathSetValue(pExJson *ExJsonVal, arrPath []string, xValue interface{}) error
- func ExJsonRawToStr(pRawJson *JsonVal) string
- func ExJsonReadMapStr(pExJson *ExJsonVal, mapSrc map[string]string)
- func ExJsonReadMapVoid(pExJson *ExJsonVal, mapSrc map[string]interface{})
- func ExJsonSet(pExJson *ExJsonVal, strKey string, xValue interface{})
- func ExJsonSetByIndex(pExJson *ExJsonVal, iIndex int, xValue interface{})
- func ExJsonSetChild(pExJson *ExJsonVal, strKey string, pExJsonChild *ExJsonVal)
- func ExJsonSetChildByIndex(pExJson *ExJsonVal, iIndex int, pExJsonChild *ExJsonVal)
- func ExJsonStructFieldToTag(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error
- func ExJsonStructFromStr(strJson string, xObj interface{}) error
- func ExJsonStructTagToField(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error
- func ExJsonStructToStr(xObj interface{}) string
- func ExJsonToArrMapStr(pExJson *ExJsonVal) []map[string]string
- func ExJsonToArrMapVoid(pExJson *ExJsonVal) []map[string]interface{}
- func ExJsonToArrStr(pExJson *ExJsonVal) []string
- func ExJsonToArrVoid(pExJson *ExJsonVal) []interface{}
- func ExJsonToMapStr(pExJson *ExJsonVal) map[string]string
- func ExJsonToMapVoid(pExJson *ExJsonVal) map[string]interface{}
- func ExJsonToPrettyStr(pExJson *ExJsonVal) string
- func ExJsonToStr(pExJson *ExJsonVal) string
- func ExJsonToStruct(pExJson *ExJsonVal, pStruct interface{}) error
- func ExJsonToStructByFieldName(pExJson *ExJsonVal, pStruct interface{}) error
- func ExJsonType(pExJson *ExJsonVal) int
- func ExJsonUnmarshal(pExJson *ExJsonVal, strJson string) error
- func FileAppendBuf(strFilePath string, bufAppend []byte) error
- func FileAppendStr(strFilePath string, strContent string) error
- func FileBrowseDirToArrAbs(strDir string) []string
- func FileBrowseDirToArrAbsRecur(strDir string, arrAbs []string)
- func FileBrowseDirToArrName(strDir string) []string
- func FileClearSubDir(strDir string) error
- func FileCopyBytes(strSrcPath string, strDestPath string) error
- func FileCopyDir(strDirSrc string, strDirDest string, strCopyAction string) error
- func FileCopyDirOneLevel(strDirSrc string, strDirDest string, strCopyAction string) error
- func FileCopyDirRecur(strDirSrc string, strDirDest string, strCopyAction string) error
- func FileGetUnicodeBom() []byte
- func FileGetUtfBom() []byte
- func FileIsAvailable(strFilePath string) bool
- func FileMakeDirAll(strDir string) error
- func FilePathDelete(strPath string) error
- func FileReadBuf(strFilePath string) []byte
- func FileReadLinesToArr(strFilePath string) []string
- func FileReadPart(strPath string, iFileOffset int64, iLen int, bufDest []byte, iBufOffset int) error
- func FileReadStr(strFilePath string) string
- func FileRemoveDir(strDir string) error
- func FileRemoveFile(strDir string) error
- func FileSetSize(strPath string, iOffset int64) error
- func FileSize(strFilePath string) int64
- func FileWriteBuf(strFilePath string, bufContent []byte) error
- func FileWritePart(strPath string, iFileOffset int64, bufToWrite []byte) error
- func FileWriteStr(strFilePath string, strContent string) error
- func FloatEqual(numLeft float64, numRight float64) bool
- func Hash8Convert10To62(strNum10 string) string
- func Hash8Convert62to10(strNum10 string) string
- func Hash8Encode(strSrc string) string
- func HttpClientGetBuf(strUrl string, iTimeoutMilli int, mapHeader map[string]string) ([]byte, error)
- func HttpClientGetResp(strUrl string, iTimeoutMilli int, mapHeader map[string]string) (*http.Response, error)
- func HttpClientGetRespWithRedirect(strUrl string, iTimeoutMilli int, mapHeader map[string]string, toRedirect bool, ...) (*http.Response, int, error)
- func HttpClientGetStr(strUrl string, iTimeoutMilli int, mapHeader map[string]string) string
- func HttpClientPostBuf(strUrl string, bufRequest []byte, iTimeoutMilli int, ...) ([]byte, error)
- func HttpClientPostStr(strUrl string, strPostData string, iTimeoutMilli int, ...) string
- func HttpsClientGetBuf(strUrl string, iTimeoutMilli int, mapHeader map[string]string) ([]byte, error)
- func HttpsClientGetStr(strUrl string, iTimeoutMilli int, mapHeader map[string]string) string
- func JsonArrAppendFloat(pJson *JsonVal, fValue float64)
- func JsonArrAppendI64(pJson *JsonVal, iValue int64)
- func JsonArrAppendInt(pJson *JsonVal, iValue int)
- func JsonArrAppendJson(pJson *JsonVal, pChildJson *JsonVal)
- func JsonArrAppendNull(pJson *JsonVal)
- func JsonArrAppendNum(pJson *JsonVal, numValue interface{})
- func JsonArrAppendText(pJson *JsonVal, strText string)
- func JsonArrClear(pJson *JsonVal)
- func JsonArrFillBlank(pJson *JsonVal, iMaxIndex int)
- func JsonArrGetBool(pJson *JsonVal, iIndex int) bool
- func JsonArrGetFloat(pJson *JsonVal, iIndex int) float64
- func JsonArrGetI64(pJson *JsonVal, iIndex int) int64
- func JsonArrGetInt(pJson *JsonVal, iIndex int) int
- func JsonArrGetStr(pJson *JsonVal, iIndex int) string
- func JsonArrGetVoid(pJson *JsonVal, iIndex int) interface{}
- func JsonArrRemoveIndex(pJson *JsonVal, iIndex int)
- func JsonArrSetBool(pJson *JsonVal, iIndex int, bValue bool)
- func JsonArrSetFloat(pJson *JsonVal, iIndex int, fValue float64)
- func JsonArrSetI64(pJson *JsonVal, iIndex int, iValue int64)
- func JsonArrSetInt(pJson *JsonVal, iIndex int, iValue int)
- func JsonArrSetJson(pJson *JsonVal, iIndex int, pChildJson *JsonVal)
- func JsonArrSetNull(pJson *JsonVal, iIndex int)
- func JsonArrSetNum(pJson *JsonVal, iIndex int, xValue interface{})
- func JsonArrSetText(pJson *JsonVal, iIndex int, strText string)
- func JsonArrSetVoid(pJson *JsonVal, iIndex int, xValue interface{})
- func JsonIsArray(pJson *JsonVal) bool
- func JsonIsCollection(pJson *JsonVal) bool
- func JsonIsEmpty(pJson *JsonVal) bool
- func JsonIsObject(pJson *JsonVal) bool
- func JsonLen(pJson *JsonVal) int
- func JsonMarshal(xObj interface{}) string
- func JsonObjClear(pJson *JsonVal)
- func JsonObjContainsKey(pJson *JsonVal, strKey string) bool
- func JsonObjGetBool(pJson *JsonVal, strKey string) bool
- func JsonObjGetFloat(pJson *JsonVal, strKey string) float64
- func JsonObjGetI64(pJson *JsonVal, strKey string) int64
- func JsonObjGetInt(pJson *JsonVal, strKey string) int
- func JsonObjGetStr(pJson *JsonVal, strKey string) string
- func JsonObjGetVoid(pJson *JsonVal, strKey string) interface{}
- func JsonObjKeys(pJson *JsonVal) []string
- func JsonObjRemoveKey(pJson *JsonVal, strKey string)
- func JsonObjSetBool(pJson *JsonVal, strKey string, bBool bool)
- func JsonObjSetFloat(pJson *JsonVal, strKey string, fValue float64)
- func JsonObjSetI64(pJson *JsonVal, strKey string, iValue int64)
- func JsonObjSetInt(pJson *JsonVal, strKey string, iValue int)
- func JsonObjSetJson(pJson *JsonVal, strKey string, pChildJson *JsonVal)
- func JsonObjSetNull(pJson *JsonVal, strKey string)
- func JsonObjSetNum(pJson *JsonVal, strKey string, xValue interface{})
- func JsonObjSetText(pJson *JsonVal, strKey string, strText string)
- func JsonObjSetVoid(pJson *JsonVal, strKey string, xValue interface{})
- func JsonParserParseByPos(pParser *JsonParser) int
- func JsonParserStackPop(pParser *JsonParser)
- func JsonParserStackPush(pParser *JsonParser, jsonNew *JsonVal)
- func JsonRefresh(pJson *JsonVal, strSrc string) error
- func JsonToArrJsonAsVoid(pJson *JsonVal) []interface{}
- func JsonToArrMapStr(pJson *JsonVal) []map[string]string
- func JsonToArrMapVoid(pJson *JsonVal) []map[string]interface{}
- func JsonToArrStr(pJson *JsonVal) []string
- func JsonToArrVoid(pJson *JsonVal) []interface{}
- func JsonToFormattedStr(pJson *JsonVal) string
- func JsonToFormattedStrByLevel(pJson *JsonVal, iLevel int) string
- func JsonToMapJson(pJson *JsonVal) map[string]*JsonVal
- func JsonToMapJsonAsVoid(pJson *JsonVal) map[string]interface{}
- func JsonToMapStr(pJson *JsonVal) map[string]string
- func JsonToMapVoid(pJson *JsonVal) map[string]interface{}
- func JsonToStr(pJson *JsonVal) string
- func JsonType(pJson *JsonVal) int
- func JsonUnmarshal(strJson string, xObj interface{}) error
- func ListBack(pList *list.List) interface{}
- func ListClear(pList *list.List)
- func ListContains(pList *list.List, pValue interface{}) bool
- func ListCreate() *list.List
- func ListFront(pList *list.List) interface{}
- func ListLen(pList *list.List) int
- func ListPeekBack(pList *list.List) interface{}
- func ListPeekFront(pList *list.List) interface{}
- func ListPopBack(pList *list.List) interface{}
- func ListPopFront(pList *list.List) interface{}
- func ListPushBack(pList *list.List, pValue interface{}) bool
- func ListPushFront(pList *list.List, pValue interface{}) bool
- func ListRemove(pList *list.List, pValue interface{}) bool
- func ListWalk(pList *list.List, fnWalk ListWalkFn) int
- func MapStrClone(mapSrc map[string]string) map[string]string
- func MapStrContains(mapSrc map[string]string, strKey string) bool
- func MapStrGetBool(mapSrc map[string]string, strKey string) bool
- func MapStrGetFloat(mapSrc map[string]string, strKey string) float64
- func MapStrGetInt(mapSrc map[string]string, strKey string) int
- func MapStrGetLong(mapSrc map[string]string, strKey string) int64
- func MapStrGetStr(mapSrc map[string]string, strKey string) string
- func MapStrSet(mapSrc map[string]string, mapDest map[string]string) int
- func MapStrToUrlStr(mapVoid map[string]string) string
- func MapVoidContains(mapSrc map[string]interface{}, strKey string) bool
- func MapVoidGetBool(mapSrc map[string]interface{}, strKey string) bool
- func MapVoidGetFloat(mapSrc map[string]interface{}, strKey string) float64
- func MapVoidGetInt(mapSrc map[string]interface{}, strKey string) int
- func MapVoidGetLong(mapSrc map[string]interface{}, strKey string) int64
- func MapVoidGetStr(mapSrc map[string]interface{}, strKey string) string
- func MapVoidGetVoid(mapSrc map[string]interface{}, strKey string) interface{}
- func MapVoidToMapStr(mapVoid map[string]interface{}) map[string]string
- func MapVoidToUrlStr(mapVoid map[string]interface{}) string
- func Md5ToLower32(strSrc string) string
- func OsEnvVar(strKey string) string
- func OsName() string
- func ProcessCurrentId() int
- func ProcessParentId() int
- func ReflectCallForStrByStr(pObj interface{}, strMethodName string, strParam string) string
- func SpJsonArrSize(jsonSp *simplejson.Json) int
- func SpJsonContains(jsonSp *simplejson.Json, strKey string) bool
- func SpJsonFromBuf(bufJson []byte) *simplejson.Json
- func SpJsonFromStr(strJson string) *simplejson.Json
- func SpJsonFromStruct(jsonSp *simplejson.Json, stObj interface{}) error
- func SpJsonFromStructByFieldName(jsonSp *simplejson.Json, xStruct interface{}) error
- func SpJsonFromStructInGroup(groupStruct interface{}) *simplejson.Json
- func SpJsonFromStructInGroupRecur(groupStruct interface{}) interface{}
- func SpJsonFromStructInGroupToStr(groupStruct interface{}) string
- func SpJsonFromStructNew(stObj interface{}) *simplejson.Json
- func SpJsonGetBool(jsonSp *simplejson.Json, strKey string) bool
- func SpJsonGetChild(jsonSp *simplejson.Json, strKey string) *simplejson.Json
- func SpJsonGetFloat(jsonSp *simplejson.Json, strKey string) float64
- func SpJsonGetI64(jsonSp *simplejson.Json, strKey string) int64
- func SpJsonGetIndexBool(jsonSp *simplejson.Json, iIndex int) bool
- func SpJsonGetIndexChild(jsonSp *simplejson.Json, iIndex int) *simplejson.Json
- func SpJsonGetIndexFloat(jsonSp *simplejson.Json, iIndex int) float64
- func SpJsonGetIndexI64(jsonSp *simplejson.Json, iIndex int) int64
- func SpJsonGetIndexInt(jsonSp *simplejson.Json, iIndex int) int
- func SpJsonGetIndexStr(jsonSp *simplejson.Json, iIndex int) string
- func SpJsonGetInt(jsonSp *simplejson.Json, strKey string) int
- func SpJsonGetStr(jsonSp *simplejson.Json, strKey string) string
- func SpJsonIsEmpty(jsonSp *simplejson.Json) bool
- func SpJsonMapContains(jsonSp *simplejson.Json, strKey string) bool
- func SpJsonMapKeys(jsonSp *simplejson.Json) []string
- func SpJsonPathGetStr(jsonSp *simplejson.Json, strPath string) string
- func SpJsonPathSetValue(jsonSp *simplejson.Json, strPath string, xValue interface{}) error
- func SpJsonReadMapStr(jsonSp *simplejson.Json, mapSrc map[string]string)
- func SpJsonReadMapVoid(jsonSp *simplejson.Json, mapSrc map[string]interface{})
- func SpJsonStructFieldToTag(jsonSpSrc *simplejson.Json, xStruct interface{}, jsonSpDest *simplejson.Json) error
- func SpJsonStructFromStr(strJson string, xObj interface{}) error
- func SpJsonStructTagToField(jsonSpSrc *simplejson.Json, xStruct interface{}, jsonSpDest *simplejson.Json) error
- func SpJsonStructToStr(xObj interface{}) string
- func SpJsonToArrMapStr(jsonArr *simplejson.Json) []map[string]string
- func SpJsonToArrMapVoid(jsonArr *simplejson.Json) []map[string]interface{}
- func SpJsonToArrStr(jsonSp *simplejson.Json) []string
- func SpJsonToArrVoid(jsonSp *simplejson.Json) []interface{}
- func SpJsonToMapStr(jsonSp *simplejson.Json) map[string]string
- func SpJsonToMapVoid(jsonSp *simplejson.Json) map[string]interface{}
- func SpJsonToPrettyStr(jsonSp *simplejson.Json) string
- func SpJsonToStr(jsonSp *simplejson.Json) string
- func SpJsonToStruct(jsonSp *simplejson.Json, stObj interface{}) error
- func SpJsonToStructByFieldName(jsonSp *simplejson.Json, xStruct interface{}) error
- func SpJsonType(jsonSp *simplejson.Json) int
- func StrAddSlashes(strSrc string, chSpecial uint8) string
- func StrByteFromHex(strHex string) uint8
- func StrByteToHex(bySrc uint8) string
- func StrCapitalize(strSrc string) string
- func StrDecodeUriComponent(strSrc string) string
- func StrEncodeUriComponent(strSrc string) string
- func StrFindChars(strSrc string, strChars string, iFromPos int) int
- func StrFindFirstNonBlank(strSrc string, iFromPos int) int
- func StrFindFirstWithoutSlash(strSrc string, chToFind uint8, iFromPos int) int
- func StrFindFrom(strSrc string, strFind string, iFromPos int) int
- func StrFindLastNonBlank(strSrc string) int
- func StrHexFromBuf(bufSrc []byte) string
- func StrHexToBuf(strHex string) []byte
- func StrIsDec(strSrc string) bool
- func StrIsInt(strSrc string) bool
- func StrIsNum(strSrc string) bool
- func StrIsSciNum(strNumLeft, strNumRight string) bool
- func StrIsWithIn(strSrc string, strCollection string) bool
- func StrPadLeft(strSrc string, strPad string, iTotalCount int) string
- func StrPadRight(strSrc string, strPad string, iTotalCount int) string
- func StrRemoveStrEnds(strSrc string, strOnEnds string) string
- func StrStripSlashes(strSrc string) string
- func StrXsvFromMap(mapXsv map[string]string, strSplit1 string, strSplit2 string) string
- func StrXsvToMap(strXsv string, strSplit1 string, strSplit2 string) map[string]string
- func StructDeepClone(pSrc interface{}) interface{}
- func StructDeepCopy(pSrc interface{}, pDest interface{}) error
- func StructInGroupDeepClone(groupStruct interface{}) interface{}
- func StructToMapVoid(xStruct interface{}, strTag string) map[string]interface{}
- func TimeFormatNowToStr(strFormat string) string
- func TimeFormatObjToMap(objTime time.Time) map[string]int
- func TimeFormatObjToStr(strFormat string, objTime time.Time) string
- func TimeFormatStamp13ToMap(iStamp13 int64) map[string]int
- func TimeFormatStamp13ToStr(strFormat string, iStamp13 int64) string
- func TimeFormattedMapIsContained(mapSmaller map[string]int, mapBigger map[string]int) bool
- func TimeFromStamp13(iStamp13 int64) time.Time
- func TimeGetMilli(xTime time.Time) int
- func TimeGetStamp13(xTime time.Time) int64
- func TimeNowStamp10() int64
- func TimeNowStamp13() int64
- type ArrVoidSortFn
- type ClockCallback
- type ClockEntity
- func (pThis *ClockEntity) AnalyzeFormat() error
- func (pThis *ClockEntity) CheckBeforeRun(iStamp13 int64) int
- func (pThis *ClockEntity) CheckBeforeRunByAbsolute(iStamp13 int64) int
- func (pThis *ClockEntity) CheckBeforeRunByInterval(iStamp13 int64) int
- func (pThis *ClockEntity) Run(iCurrentStamp13 int64)
- func (pThis *ClockEntity) RunSync(iCurrentStamp13 int64)
- type ClockManager
- func (pThis *ClockManager) AddAbsolute(strEventName string, strActionType string, strActionContent string, ...) error
- func (pThis *ClockManager) AddEntity(pEntity *ClockEntity) error
- func (pThis *ClockManager) AddInterval(strEventName string, strActionType string, strActionContent string, ...) error
- func (pThis *ClockManager) Clear()
- func (pThis *ClockManager) IsRunning() bool
- func (pThis *ClockManager) Loop()
- func (pThis *ClockManager) RemoveEntity(strEventName string) error
- func (pThis *ClockManager) SetRunning(bRunning bool)
- func (pThis *ClockManager) Start() error
- func (pThis *ClockManager) Stop()
- type DataHolder
- func (my *DataHolder) GetBool() bool
- func (my *DataHolder) GetBuf() []byte
- func (my *DataHolder) GetFloat() float64
- func (my *DataHolder) GetInt() int
- func (my *DataHolder) GetLong() int64
- func (my *DataHolder) GetObj() interface{}
- func (my *DataHolder) GetStr() string
- func (my *DataHolder) GetType() string
- func (my *DataHolder) SetBool(bData bool)
- func (my *DataHolder) SetBuf(bufData []byte)
- func (my *DataHolder) SetFloat(fData float64)
- func (my *DataHolder) SetInt(iData int)
- func (my *DataHolder) SetLong(iLong int64)
- func (my *DataHolder) SetObj(xData interface{})
- func (my *DataHolder) SetStr(strData string)
- func (my *DataHolder) ToJsonStr() string
- func (my *DataHolder) ToStrByFormat(strFormat string) string
- func (my *DataHolder) ToUrlStr() string
- type ExJsonVal
- func ExJsonClone(pExJson *ExJsonVal) *ExJsonVal
- func ExJsonFromBuf(bufJson []byte) *ExJsonVal
- func ExJsonFromStr(strJson string) *ExJsonVal
- func ExJsonFromStructInGroup(groupStruct interface{}) *ExJsonVal
- func ExJsonFromStructNew(xStruct interface{}) *ExJsonVal
- func ExJsonGetChild(pExJson *ExJsonVal, strKey string) *ExJsonVal
- func ExJsonGetChildByIndex(pExJson *ExJsonVal, iIndex int) *ExJsonVal
- func ExJsonNewArray() *ExJsonVal
- func ExJsonNewObject() *ExJsonVal
- func ExJsonParse(strText string) *ExJsonVal
- func ExJsonPathGetChild(pExJson *ExJsonVal, arrPath []string) *ExJsonVal
- func ExJsonRawToPtr(pRawJson *JsonVal) *ExJsonVal
- func ExJsonRawToVal(valRawJson JsonVal) ExJsonVal
- type JsonParser
- type JsonVal
- func ExJsonRawFromPtr(pExJson *ExJsonVal) *JsonVal
- func ExJsonRawFromVal(valExJson ExJsonVal) JsonVal
- func JsonArrGetJson(pJson *JsonVal, iIndex int) *JsonVal
- func JsonFromStr(strSrc string) *JsonVal
- func JsonNewArray() *JsonVal
- func JsonNewNone() *JsonVal
- func JsonNewObject() *JsonVal
- func JsonObjGetJson(pJson *JsonVal, strKey string) *JsonVal
- func JsonParserResult(pParser *JsonParser) *JsonVal
- func JsonParserStackTopJson(pParser *JsonParser) *JsonVal
- func JsonToArrJson(pJson *JsonVal) []*JsonVal
- type ListWalkFn
Constants ¶
const CLOCK_ABSOLUTE_FORMAT_DATE string = "0000-00-00 00:00:00"
const CLOCK_ABSOLUTE_FORMAT_WEEK string = "0 00:00:00"
const CLOCK_ACTION_TYPE_CALLBACK string = "callback"
const CLOCK_ACTION_TYPE_CMD string = "cmd"
const CLOCK_ACTION_TYPE_URL string = "url"
const CLOCK_CHECK_RESULT_REMOVE int = 2
const CLOCK_CHECK_RESULT_RUN int = 1
const CLOCK_CHECK_RESULT_SLEEP int = 0
const CLOCK_ENTITY_HTTP_TIMEOUT int = 30 * 1000
const CLOCK_FIELD_ABSOLUTE_FORMAT string = "AbsoluteFormat"
const CLOCK_FIELD_ABSOLUTE_MAP string = "AbsoluteMap"
const CLOCK_FIELD_ABSOLUTE_MIN_SPAN string = "AbsoluteMinSpan"
const CLOCK_FIELD_ABSOLUTE_PERIOD string = "AbsolutePeriod"
const CLOCK_FIELD_ACTION_CONTENT string = "ActionContent"
const CLOCK_FIELD_ACTION_TYPE string = "ActionType"
const CLOCK_FIELD_CALLBACK_IMPL string = "CallbackImpl"
const CLOCK_FIELD_CURRENT_COUNT string = "CurrentCount"
const CLOCK_FIELD_EVENT_NAME string = "EventName"
const CLOCK_FIELD_FIRST_DELAY string = "FirstDelay"
const CLOCK_FIELD_INTERVAL string = "Interval"
const CLOCK_FIELD_LAST_TIME string = "LastTime"
const CLOCK_FIELD_MAX_COUNT string = "MaxCount"
const CLOCK_FIELD_PARAM_OBJECT string = "ParamObject"
const CLOCK_FIELD_SETUP_TIME string = "SetupTime"
const CLOCK_FIELD_TIME_TYPE string = "TimeType"
const CLOCK_FIELD_TO_RUN_IN_THE_SAME_THREAD string = "ToRunInTheSameThread"
const CLOCK_MANAGER_INTERVAL int64 = 100
const CLOCK_TIME_TYPE_ABSOLUTE string = "absolute"
const CLOCK_TIME_TYPE_INTERVAL string = "interval"
const COMMON_NOT_FOUND = -1
const DATA_HOLDER_TYPE_BOOL string = "bool"
const DATA_HOLDER_TYPE_BUF string = "buf"
const DATA_HOLDER_TYPE_FLOAT string = "float"
const DATA_HOLDER_TYPE_INT string = "int"
const DATA_HOLDER_TYPE_LONG string = "int64"
const DATA_HOLDER_TYPE_MIXED string = "mixed"
const DATA_HOLDER_TYPE_NONE string = "empty"
const DATA_HOLDER_TYPE_OBJ string = "obj"
const DATA_HOLDER_TYPE_STR string = "str"
const FILE_COPY_ACTION_OVERWRITE_EXISTED = "ovewrite_existed"
const FILE_COPY_ACTION_SKIP_EXISTED = "skip_existed"
const FILE_PERM_DEFAULT = 0755
const FILE_TEMP_BUF_DEFAULT = 4096
const FLOAT_COMPARE_DIFF = 0.00001
const JSON_CH_B_SLASH byte = '\\'
const JSON_CH_COLON byte = ':'
const JSON_CH_COMMA byte = ','
const JSON_CH_D_QUOTE byte = '"'
const JSON_CH_L_B_L byte = '{'
const JSON_CH_L_B_R byte = '}'
const JSON_CH_M_B_L byte = '['
const JSON_CH_M_B_R byte = ']'
const JSON_CH_SPACE byte = ' '
const JSON_ET_TYPE_NAME string = "et.JsonVal"
const JSON_INDENT_SIZE int = 2
const JSON_STR_B_SLASH string = "\\"
const JSON_STR_COLON string = ":"
const JSON_STR_COMMA string = ","
const JSON_STR_D_QUOTE string = "\""
const JSON_STR_FALSE string = "false"
const JSON_STR_LINE string = "\r\n"
const JSON_STR_L_B_L string = "{"
const JSON_STR_L_B_R string = "}"
const JSON_STR_M_B_L string = "["
const JSON_STR_M_B_R string = "]"
const JSON_STR_NULL string = "null"
const JSON_STR_SPACE string = " "
const JSON_STR_TRUE string = "true"
const JSON_TYPE_ARRAY int = 5
const JSON_TYPE_BOOL int = 3
const JSON_TYPE_NONE int = 0
const JSON_TYPE_NULL int = 4
const JSON_TYPE_NUM int = 2
const JSON_TYPE_OBJECT int = 6
const JSON_TYPE_TEXT int = 1
const OS_DARWIN = "darwin"
const OS_LINUX = "linux"
const OS_WINDOWS = "windows"
const REGEX_CHINESE_RULE = "^[\\u4e00-\\u9fa5]*$"
中文验证
const REGEX_EMAIL_RULE = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"
邮箱规则
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}$"
手机号规则(进阶)
const REGEX_MULTI_PHONE_RULE = "^1[34578][0-9]{9}(,1[34578][0-9]{9})*$"
多手机号规则,逗号相隔
const REGEX_NUM_OR_LETTER_RULE = "^[0-9a-zA-Z]*$"
验证是数字和字母含大小写
const REGEX_NUM_RULE = "^[0-9]*$"
纯数字验证
const REGEX_PASSWORD_RULE = "^[0-9a-zA-Z](?=.*\\d.*)(?=.*[a-zA-Z].*)(?!.*\\s.*).[A-Za-z0-9]{6,20}$"
密码验证,6-20位、由数字与字母构成、至少包含一位数字和一位字母、不可带空格
const REGEX_PHONE_RULE = "^1[3456789]\\d{9}$"
手机号规则
const REGEX_QQ_RULE = "[1-9][0-9]{4,14}"
多手机号规则,逗号相隔
const REGEX_TEL_RULE = "^[1-9]{1}[0-9]{5,8}$"
固话验证
const REGEX_TEL_ZONE_RULE = "^[0][1-9][0-9]{1,2}-[0-9]{5,10}$"
固话验证带区号
const REGEX_THREE_NUMERIC_RULE = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,3})?$"
包含三位小数
const STR_BLANK_CH string = " \r\n\t"
const STR_HEX_CHAR_LOWER string = "0123456789abcdef"
const STR_HEX_CHAR_UPPER string = "0123456789ABCDEF"
const TIME_FORMAT_DAY string = "d"
const TIME_FORMAT_HOUR string = "h"
const TIME_FORMAT_MILLI string = "l"
const TIME_FORMAT_MINUTE string = "i"
const TIME_FORMAT_MONTH string = "m"
const TIME_FORMAT_PREFIX string = "%"
* 本工具包内时间的各个字段的字母标识
const TIME_FORMAT_SECOND string = "s"
const TIME_FORMAT_WEEK string = "w"
const TIME_FORMAT_YEAR string = "y"
Variables ¶
var ClockManagerStatic = struct { DefaultInstance *ClockManager }{ DefaultInstance: nil, }
var FILE_BOM_UNICODE []byte = []byte{0xff, 0xfe}
var FILE_BOM_UTF8 []byte = []byte{0xef, 0xbb, 0xbf}
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 Base64DecStrToBuf ¶
func Base64DecStrToBufForUrl ¶
func Base64DecStrToStr ¶
func Base64DecStrToStrForUrl ¶
func Base64EncBufToStr ¶
func Base64EncBufToStrForUrl ¶
func Base64EncStrToStr ¶
func Base64EncStrToStrForUrl ¶
func ByteFindFrom ¶
* 查找字节流中是否包含某一部分
func CastBoolToNumStr ¶
func CastBoolToStr ¶
func CastBufToStr ¶
func CastErrToStr ¶
func CastF64ToStr ¶
func CastI64ToStr ¶
func CastIntToBool ¶
func CastIntToStr ¶
func CastStrToBool ¶
* 把字符串转换为bool, 会识别,true,false,0,1, 其他的情况下,非空即为真
func CastStrToF64 ¶
func CastStrToI64 ¶
func CastStrToInt ¶
func CastVoidToStr ¶
func CastVoidToStr(xValue interface{}) string
* 把未知类型转化为相应的字符串 如果是结构体,会调用其String方法。 若无,则返回空字符串
func CmdOutputState ¶
func CmdOutputState(chState chan int, pStrError *string, pStrResult *string, strCmd string, arg ...string)
* 执行一个系统命令,并获得返回值,带一个通道,用于同步状态 返回值中包含普通输出流和错误输出流中的内容
func CmdOutputTimeout ¶
* 执行一个系统命令,并获得返回值,带有超时时间,以毫秒计算 返回值中包含普通输出流和错误输出流中的内容
func ExJsonClear ¶
func ExJsonClear(pExJson *ExJsonVal)
func ExJsonFromStruct ¶
* 把一个结构体转换为json对象
func ExJsonFromStructByFieldName ¶
* 根据字段名而不是tag把一个结构体转化为json
func ExJsonFromStructInGroupRecur ¶
func ExJsonFromStructInGroupRecur(groupStruct interface{}) interface{}
* 把一组struct转换为json,递归
func ExJsonFromStructInGroupToStr ¶
func ExJsonFromStructInGroupToStr(groupStruct interface{}) string
* 把一组结构体序列化为字符串
func ExJsonGetIndexFloat ¶
* 根据索引获得浮点数
func ExJsonGetStrByIndex ¶
* 根据索引获得字符串
func ExJsonMapContains ¶
* 判断此json中是否包含某个键
func ExJsonPathGetStr ¶
* 根据jsonpath得到一个字符串,path是一个数组,依次是每个节点的键名,如果是数组索引请用[]包装数字
func ExJsonPathSetValue ¶
* 根据jsonpath设置json,path是一个数组,依次是每个节点的键名,如果是数组索引请用[]包装数字
func ExJsonReadMapStr ¶
* 把一个字符串map的内容的所有键遍历读到一个json中
func ExJsonReadMapVoid ¶
* 把一个空类型map的内容的所有键遍历读到一个json中
func ExJsonSetByIndex ¶
func ExJsonSetChild ¶
func ExJsonSetChildByIndex ¶
func ExJsonStructFieldToTag ¶
func ExJsonStructFieldToTag(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error
* 给定一个结构体,把原先由字段名得到的json转换为以为tag键
func ExJsonStructFromStr ¶
* 把字符串反序列化为结构体,利用json做转换
func ExJsonStructTagToField ¶
func ExJsonStructTagToField(pExJsonSrc *ExJsonVal, pStruct interface{}, pExJsonDest *ExJsonVal) error
* 给定一个结构体,把原先由tag得到的json转换为以字段名为键
func ExJsonToArrMapStr ¶
* 把json对象转为字符串map的数组,是一个2维对象
func ExJsonToArrMapVoid ¶
* 把json对象转换为空类型map的数组,是一个2维对象
func ExJsonToMapVoid ¶
* 把json对象转换为无类型map
func ExJsonToPrettyStr ¶
* 把json对象格式化输出为字符串,会有良好的排版。
func ExJsonToStruct ¶
* 把json对象转换到一个已存在的结构体中
func ExJsonToStructByFieldName ¶
* 根据字段名,把json对象转换到一个结构体中
func ExJsonUnmarshal ¶
* 把json字符串解析到现有的son对象中,与parse的区别是,不产生新对象。
func FileBrowseDirToArrAbs ¶
* 把目录下的文件或目录读到一个数组,此数组内的元素都是绝对路径,如果是子目录,则会在后面加上/ will add a slash to every dir
func FileBrowseDirToArrAbsRecur ¶
* 把目录下的文件或目录读到一个数组,遍历所有子目录,如果是子目录,则会在后面加上/ will add a slash to every dir
func FileBrowseDirToArrName ¶
* 把目录下的文件或目录读到一个数组,如果是子目录,则会在后面加上/ will add a slash to every dir
func FileCopyDir ¶
* 拷贝整个目录
func FileCopyDirOneLevel ¶
* 仅仅拷贝单层目录
func FileCopyDirRecur ¶
func FileGetUnicodeBom ¶
func FileGetUnicodeBom() []byte
func FileGetUtfBom ¶
func FileGetUtfBom() []byte
func FileReadPart ¶
func FileReadPart(strPath string, iFileOffset int64, iLen int, bufDest []byte, iBufOffset int) error
* 分段读取文件
func FileWritePart ¶
* 分段写入文件
func Hash8Convert10To62 ¶
func Hash8Convert62to10 ¶
func Hash8Encode ¶
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 ¶
* 用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 HttpsClientGetStr ¶
* https操作类,一般不需要用,因为go http内置工具会在底层判断https。
func JsonArrAppendFloat ¶
func JsonArrAppendI64 ¶
func JsonArrAppendInt ¶
func JsonArrAppendJson ¶
func JsonArrAppendNull ¶
func JsonArrAppendNull(pJson *JsonVal)
func JsonArrAppendNum ¶
func JsonArrAppendNum(pJson *JsonVal, numValue interface{})
func JsonArrAppendText ¶
func JsonArrClear ¶
func JsonArrClear(pJson *JsonVal)
func JsonArrFillBlank ¶
func JsonArrGetBool ¶
func JsonArrGetFloat ¶
func JsonArrGetI64 ¶
func JsonArrGetInt ¶
func JsonArrGetStr ¶
func JsonArrGetVoid ¶
func JsonArrRemoveIndex ¶
func JsonArrSetBool ¶
func JsonArrSetFloat ¶
func JsonArrSetI64 ¶
func JsonArrSetInt ¶
func JsonArrSetJson ¶
func JsonArrSetNull ¶
func JsonArrSetNum ¶
func JsonArrSetText ¶
func JsonArrSetVoid ¶
func JsonIsArray ¶
func JsonIsCollection ¶
func JsonIsEmpty ¶
func JsonIsObject ¶
func JsonMarshal ¶
func JsonMarshal(xObj interface{}) string
func JsonObjClear ¶
func JsonObjClear(pJson *JsonVal)
func JsonObjContainsKey ¶
func JsonObjGetBool ¶
func JsonObjGetFloat ¶
func JsonObjGetI64 ¶
func JsonObjGetInt ¶
func JsonObjGetStr ¶
func JsonObjGetVoid ¶
func JsonObjKeys ¶
func JsonObjRemoveKey ¶
func JsonObjSetBool ¶
func JsonObjSetFloat ¶
func JsonObjSetI64 ¶
func JsonObjSetInt ¶
func JsonObjSetJson ¶
func JsonObjSetNull ¶
func JsonObjSetNum ¶
func JsonObjSetText ¶
func JsonObjSetVoid ¶
func JsonParserParseByPos ¶
func JsonParserParseByPos(pParser *JsonParser) int
func JsonParserStackPop ¶
func JsonParserStackPop(pParser *JsonParser)
func JsonParserStackPush ¶
func JsonParserStackPush(pParser *JsonParser, jsonNew *JsonVal)
func JsonRefresh ¶
func JsonToArrJsonAsVoid ¶
func JsonToArrJsonAsVoid(pJson *JsonVal) []interface{}
func JsonToArrMapStr ¶
func JsonToArrMapVoid ¶
func JsonToArrStr ¶
func JsonToArrVoid ¶
func JsonToArrVoid(pJson *JsonVal) []interface{}
func JsonToFormattedStr ¶
func JsonToMapJson ¶
func JsonToMapJsonAsVoid ¶
func JsonToMapStr ¶
func JsonToMapVoid ¶
func JsonUnmarshal ¶
func ListContains ¶
func ListCreate ¶
func ListPeekBack ¶
func ListPeekFront ¶
func ListPopBack ¶
func ListPopFront ¶
func ListPushBack ¶
func ListPushFront ¶
func ListRemove ¶
func MapStrGetFloat ¶
* 根据键名获得浮点型
func MapVoidContains ¶
* 是否包含相应的键
func MapVoidGetBool ¶
* 根据键名获得布尔型
func MapVoidGetFloat ¶
* 根据键名获得浮点型
func MapVoidGetInt ¶
* 根据键名获得数值
func MapVoidGetLong ¶
* 根据键名获得长整型
func MapVoidGetStr ¶
* 根据键名获得字符串
func MapVoidGetVoid ¶
* 根据键名获得interface
func MapVoidToMapStr ¶
* 把map void 转换为map str
func MapVoidToUrlStr ¶
* 把map void转换为一个url字符串
func ProcessCurrentId ¶
func ProcessCurrentId() int
func ProcessParentId ¶
func ProcessParentId() int
func ReflectCallForStrByStr ¶
* 根据名称执行对象的方法,参数是一个字符串,返回值也是一个字符串
func SpJsonArrSize ¶
func SpJsonArrSize(jsonSp *simplejson.Json) int
func SpJsonContains ¶
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 SpJsonGetChild ¶
func SpJsonGetChild(jsonSp *simplejson.Json, strKey string) *simplejson.Json
func SpJsonGetFloat ¶
func SpJsonGetI64 ¶
func SpJsonGetIndexBool ¶
func SpJsonGetIndexChild ¶
func SpJsonGetIndexChild(jsonSp *simplejson.Json, iIndex int) *simplejson.Json
func SpJsonGetIndexFloat ¶
func SpJsonGetIndexI64 ¶
func SpJsonGetIndexInt ¶
func SpJsonGetIndexStr ¶
func SpJsonGetInt ¶
func SpJsonGetStr ¶
func SpJsonIsEmpty ¶
func SpJsonIsEmpty(jsonSp *simplejson.Json) bool
func SpJsonMapContains ¶
func SpJsonMapKeys ¶
func SpJsonMapKeys(jsonSp *simplejson.Json) []string
func SpJsonPathGetStr ¶
func SpJsonPathSetValue ¶
func SpJsonReadMapStr ¶
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 SpJsonStructTagToField ¶
func SpJsonStructTagToField(jsonSpSrc *simplejson.Json, xStruct interface{}, jsonSpDest *simplejson.Json) error
func SpJsonStructToStr ¶
func SpJsonStructToStr(xObj interface{}) string
func SpJsonToArrMapStr ¶
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 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 StrFindChars ¶
* 只要strSrc中出现strChars中的任意一个字符,则返回出现的位置
func StrFindFirstWithoutSlash ¶
* 找到第一个某字符,前面不是反斜杠的,也就是非专业
func StrPadLeft ¶
* 在字符串的左边补齐字符
func StrPadRight ¶
* 在字符串右边补齐字符
func StrRemoveStrEnds ¶
* 删除两端的字符串。比如两端的引号。
func StrXsvFromMap ¶
* 把一个字符MAP序列化为xsv,分隔符是split1,和split2
func StrXsvToMap ¶
* 把一个字符串按两种切割符号切两轮,形成一个字符map,比如&与= Xsv的含义是Csv,只是不一定是用逗号
func StructInGroupDeepClone ¶
func StructInGroupDeepClone(groupStruct interface{}) interface{}
* 结构体数组或者MAP深度复制
func StructToMapVoid ¶
* 把结构体转换为一个map
func TimeFormatObjToMap ¶
* 把时间格式化为一个map,键名就是各个字母标识,定义在常量中
func TimeFormatObjToStr ¶
* 把时间对象格式化为字符串,格式中的%x 会被替换为实际的时间值,比如%y是年,%m是月
func TimeFormatStamp13ToMap ¶
* 把13位时间戳转换为map
func TimeFormatStamp13ToStr ¶
* 根据13为时间戳格式化为字符串
func TimeFormattedMapIsContained ¶
* 一个时间相关的map中是否包含某个键
Types ¶
type ArrVoidSortFn ¶
type ArrVoidSortFn func(pLeft interface{}, pRight interface{}) int
type ClockCallback ¶
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) 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)
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 ExJsonFromStructInGroup ¶
func ExJsonFromStructInGroup(groupStruct interface{}) *ExJsonVal
* 把一组struct转换为json
func ExJsonFromStructNew ¶
func ExJsonFromStructNew(xStruct interface{}) *ExJsonVal
* 根据一个结构体,创建新的json对象
func ExJsonGetChild ¶
* 根据键名获得下级json节点
func ExJsonGetChildByIndex ¶
* 根据索引获得下级json
func ExJsonPathGetChild ¶
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 JsonArrGetJson ¶
func JsonFromStr ¶
///////////////////////////////////////////////////////////////
func JsonNewArray ¶
func JsonNewArray() *JsonVal
func JsonNewNone ¶
func JsonNewNone() *JsonVal
func JsonNewObject ¶
func JsonNewObject() *JsonVal
func JsonObjGetJson ¶
func JsonParserResult ¶
func JsonParserResult(pParser *JsonParser) *JsonVal
func JsonParserStackTopJson ¶
func JsonParserStackTopJson(pParser *JsonParser) *JsonVal
func JsonToArrJson ¶
func (JsonVal) EtTypeName ¶
func (JsonVal) JsonValTag ¶
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
Source Files ¶
- Arr.go
- Base64.go
- Byte.go
- Cast.go
- Clock.go
- Cmd.go
- Common.go
- CondManager.go
- CoroutineDiff.go
- CoroutinePool.go
- CoroutinePusher.go
- CoroutineSame.go
- DataHolder.go
- Des.go
- ExJson.go
- File.go
- Float.go
- Hash8.go
- HttpClient.go
- HttpsClient.go
- Json.go
- KvQueue.go
- List.go
- LockManager.go
- Map.go
- Md5.go
- MemCache.go
- Os.go
- Process.go
- Reflect.go
- Regex.go
- Rsa.go
- SpJson.go
- Str.go
- Struct.go
- TaskDispatcher.go
- Time.go