Documentation ¶
Index ¶
- Variables
- func AppendFile(filepath string, content []byte) error
- func CheckAjaxPermission(ajaxfunc string, user string) bool
- func CheckURLPermission(url string, user string) bool
- func Convert2JSON(data interface{}) []byte
- func DecodeGBK2UTF8(in []byte) ([]byte, error)
- func FuncCall(mName string, params ...interface{}) ([]reflect.Value, error)
- func GetAjaxRetJSON(retcode string, errmsg error) []byte
- func GetAjaxRetWithDataJSON(retcode string, errmsg error, data interface{}) []byte
- func GetConfig(section string, option string) string
- func GetConfigInt(section string, option string) int
- func GetJSONResultFromRequestBody(reqBody []byte, path string) gjson.Result
- func GetMd5String(s string) string
- func GetRetMsg(retcode string) string
- func GetUniqueID() string
- func InitConfig(path string) error
- func InitDB(dbtype string, dbstr string) error
- func InitFunctionMap(objs ...interface{})
- func InitLogger(path string) error
- func NewFtpClient(host string, username string, password string) (*ftp.ServerConn, error)
- func RandString(len int) string
- func RandomNumber(len int) string
- func RandomString(len int) string
- func ReadJSONData2Array(reqBody []byte, path string) []gjson.Result
- func ReadLines(filename string) ([]string, error)
- func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error)
- func ReadRequestBody2JSON(reqBody io.ReadCloser) []byte
- func ReflectCall(m map[string]interface{}, name string, params ...interface{}) ([]reflect.Value, error)
- func SendHXMsg(uuid string, title string, tos string, data string) error
- func WriteFile(filename string, content string) error
- func WriteRunLog2File(uuid string, content []byte, beginTimeStr string, endTimeStr string) (string, error)
- type AjaxReturn
- type AjaxReturnWithData
- type FunctionMap
Constants ¶
This section is empty.
Variables ¶
var Engine *xorm.Engine
Engine xorm
Functions ¶
func AppendFile ¶
AppendFile func(filepath string, content []byte) error
func CheckAjaxPermission ¶
CheckAjaxPermission func(ajaxfunc string, user string) bool
func CheckURLPermission ¶
CheckURLPermission func(ajaxfunc string, user string) bool
func GetAjaxRetJSON ¶
GetAjaxRetJSON func(retcode string, errmsg error) []byte Get return code and errors Convert to AjaxReturn struct and Marshal to JSON
func GetAjaxRetWithDataJSON ¶
GetAjaxRetWithDataJSON func(retcode string, errmsg error, data []byte) []byte Get return message and data Convert to AjaxReturnWithData struct and Marshal to JSON
func GetConfigInt ¶
GetConfigInt func(section string, option string) int Return String
func GetJSONResultFromRequestBody ¶
GetJSONResultFromRequestBody func(reqBody []byte, path string) gjson.Result
func InitConfig ¶
InitConfig func(path string) error Initialize The Config Global Variable
func InitLogger ¶
InitLogger initial a logger by seelog Default config file SeelogCfg = "./config/seelog.xml"
func NewFtpClient ¶
NewFtpClient func(host string, username string, password string) (*ftp.ServerConn, error)
func ReadJSONData2Array ¶
ReadJSONData2Array func(reqBody []byte, path string) []gjson.Result
func ReadLines ¶
ReadLines reads contents from file and splits them by new line. A convenience wrapper to ReadLinesOffsetN(filename, 0, -1).
func ReadLinesOffsetN ¶
ReadLinesOffsetN reads contents from file and splits them by new line. The offset tells at which line number to start. The count determines the number of lines to read (starting from offset):
n >= 0: at most n lines n < 0: whole file
func ReadRequestBody2JSON ¶
func ReadRequestBody2JSON(reqBody io.ReadCloser) []byte
ReadRequestBody2JSON func(reqBody io.ReadCloser) []byte
func ReflectCall ¶
func ReflectCall(m map[string]interface{}, name string, params ...interface{}) ([]reflect.Value, error)
ReflectCall func(m map[string]interface{}, name string, params ...interface{}) ([]reflect.Value, error)
Types ¶
type AjaxReturn ¶
AjaxReturn struct
func GetAjaxRetObj ¶
func GetAjaxRetObj(retcode string, errmsg error) AjaxReturn
GetAjaxRetObj func(retcode string, errmsg error) AjaxReturn Get return code and errors Convert to AjaxReturn struct object
type AjaxReturnWithData ¶
type AjaxReturnWithData struct { AjaxReturn RetData interface{} `json:"retdata"` }
AjaxReturnWithData struct
func GetAjaxRetWithDataObj ¶
func GetAjaxRetWithDataObj(retcode string, errmsg error, data interface{}) AjaxReturnWithData
GetAjaxRetWithDataObj func(retcode string, errmsg error, data []byte) AjaxReturnWithData Get return message and data Convert to AjaxReturnWithData struct object