Documentation ¶
Overview ¶
Package utils defines some common varients.
Index ¶
- Constants
- func BytesToInt(buf []byte) int64
- func BytesToInt32(buf []byte) int32
- func BytesToUInt32(buf []byte) uint32
- func Int32ToBytes(val int32) []byte
- func IntToBytes(v int64, cnts int) []byte
- func JKBitValue(value, start, cout uint) uint
- func JKBitValueByte(value byte, start, cout uint) uint
- func JKFileLists(path string, dir, file bool) ([]string, error)
- func JKReadFileData(filename string) (string, error)
- func JKSaveDataToFile(filename string, data []byte, clear bool) error
- func JKSaveFileData(id, filename, data string) bool
- type M
- type Result
- func (r *Result) GetData() interface{}
- func (r *Result) GetDesc() string
- func (r *Result) GetStatus() int
- func (Result) JavaClassName() string
- func (r *Result) Set401()
- func (r *Result) SetData(data interface{})
- func (r *Result) SetItemExist()
- func (r *Result) SetItemNotExist()
- func (r *Result) SetOK()
- type ResultStatus
- func (rs *ResultStatus) GetCode() int
- func (rs *ResultStatus) GetData(result interface{})
- func (rs *ResultStatus) GetDesc() string
- func (rs *ResultStatus) SetArgsInvalid()
- func (rs *ResultStatus) SetCustom(v int, desc string)
- func (rs *ResultStatus) SetData(data interface{})
- func (rs *ResultStatus) SetInsertFail()
- func (rs *ResultStatus) SetItemDelFail()
- func (rs *ResultStatus) SetItemExist()
- func (rs *ResultStatus) SetItemModFail()
- func (rs *ResultStatus) SetItemNotExist()
- func (rs *ResultStatus) SetNoPermission()
Constants ¶
View Source
const ( JK_RESULT_SUCCESS = 0 JK_RESULT_OK = 200 JK_RESULT_E_FAIL = -100 - iota JK_RESULT_E_PARAM_ERROR JK_RESULT_E_PARSE_ERROR JK_RESULT_E_DATABASE_QUERY_ERROR JK_RESULT_E_DATABASE_INSERT_ERROR JK_RESULT_E_DATABASE_MOD_ERROR JK_RESULT_E_DATABASE_REMOVE_ERROR JK_RESULT_E_NOT_EXIST JK_RESULT_E_HAS_EXIST JK_RESULT_E_DATA_NOT_EXIST JK_RESULT_E_CODE_ERROR JK_RESULT_E_NET_DIAL_ERROR JK_RESULT_E_TIME_FAST JK_RESULT_E_NOTSUPPORT JK_RESULT_E_NO_PERMISSION )
View Source
const ( JK_NET_ADDRESS_LOCAL = "0.0.0.0" JK_NET_ADDRESS_PORT = 23888 JK_SERVER_FILE_POSITION = "kflogs" )
Variables ¶
This section is empty.
Functions ¶
func BytesToInt ¶
func BytesToInt32 ¶
func BytesToUInt32 ¶
func Int32ToBytes ¶
func JKBitValue ¶
0000 0000 0000 0000 0000 0000 00000 0000
func JKBitValueByte ¶
func JKFileLists ¶
Give a filepath return all the directory or files @dir: if get directory @file: if get files.
func JKReadFileData ¶
func JKSaveFileData ¶
Types ¶
type Result ¶
func (Result) JavaClassName ¶
func (*Result) SetItemExist ¶
func (r *Result) SetItemExist()
func (*Result) SetItemNotExist ¶
func (r *Result) SetItemNotExist()
type ResultStatus ¶
type ResultStatus struct {
RS map[string]interface{}
}
func NewResultStatus ¶
func NewResultStatus(v int, desc string) *ResultStatus
func (*ResultStatus) GetCode ¶
func (rs *ResultStatus) GetCode() int
func (*ResultStatus) GetData ¶
func (rs *ResultStatus) GetData(result interface{})
func (*ResultStatus) GetDesc ¶
func (rs *ResultStatus) GetDesc() string
func (*ResultStatus) SetArgsInvalid ¶
func (rs *ResultStatus) SetArgsInvalid()
func (*ResultStatus) SetCustom ¶
func (rs *ResultStatus) SetCustom(v int, desc string)
func (*ResultStatus) SetData ¶
func (rs *ResultStatus) SetData(data interface{})
func (*ResultStatus) SetInsertFail ¶
func (rs *ResultStatus) SetInsertFail()
func (*ResultStatus) SetItemDelFail ¶
func (rs *ResultStatus) SetItemDelFail()
func (*ResultStatus) SetItemExist ¶
func (rs *ResultStatus) SetItemExist()
func (*ResultStatus) SetItemModFail ¶
func (rs *ResultStatus) SetItemModFail()
func (*ResultStatus) SetItemNotExist ¶
func (rs *ResultStatus) SetItemNotExist()
func (*ResultStatus) SetNoPermission ¶
func (rs *ResultStatus) SetNoPermission()
Click to show internal directories.
Click to hide internal directories.