Documentation ¶
Index ¶
- func ArrayChunkInt32(array []int32, num int) [][]int32
- func ArrayChunkStr(array []string, num int) [][]string
- func CallFunc(body CallBody) (result []interface{}, err error)
- func CombineFieldFloat32(old interface{}, ne interface{}) (float32, error)
- func CombineFieldInt32(old interface{}, ne interface{}) (int32, error)
- func DivideInt32(dividend int32, divisor int32, mul ...int32) (float64, error)
- func GetCurrPath() string
- func GetStructStringField(input interface{}, key string) (value string, err error)
- func HTTPGet(requestURI string, params map[string]string, header map[string]string) ([]byte, error)
- func HTTPPost(requestURI string, params map[string]string, header map[string]string) ([]byte, error)
- func InterfaceToResult(resultList []interface{}, returnItems ...interface{}) error
- func Split(str string, step string) []string
- func StructByReflect(beforeMap map[string]interface{}, inStructPtr interface{}) error
- func TimeFormatInt32(tt int32, format ...string) (string, error)
- type CallBody
- type CallTask
- type KT
- type ResponseBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineFieldFloat32 ¶
func CombineFieldInt32 ¶
func GetStructStringField ¶
GetStructStringField 获取struct中指定key的string值
func InterfaceToResult ¶
func InterfaceToResult(resultList []interface{}, returnItems ...interface{}) error
InterfaceToResult 将interface 里面的字段赋值给后面各种变量
func StructByReflect ¶
StructByReflect 遍历struct并且自动进行赋值
Types ¶
type CallBody ¶
type CallBody struct { FuncName interface{} // 要执行的函数本体 Params []interface{} // 要传的函数参数, 需要类型和数量都保持一致 }
CallBody 单个函数的请求体
type KT ¶
func GetStructKeyType ¶
GetStructKeyType 获取struct的kv结构
type ResponseBody ¶
type ResponseBody struct { Result []interface{} // 函数返回的所有结果(包括常用 error), 包括业务返回的错误 Index int // 传入时的顺序 Err error // 函数在 callBack 里调用时的错误 }
func BatchExec ¶
func BatchExec(task CallTask) (resultList []ResponseBody, err error)
BatchExec 并发执行, 需限制总的并发数量
func SyncBatchExec ¶
func SyncBatchExec(task CallTask) (resultList []ResponseBody, err error)
SyncBatchExec 同步执行, 用于不方便并发执行的业务
func (*ResponseBody) GetResult ¶
func (resp *ResponseBody) GetResult(returnItems ...interface{}) error
GetResult 将返回结果以反射的方式赋值给传入参数
Source Files ¶
Click to show internal directories.
Click to hide internal directories.