MCPcopy
hub / github.com/eolinker/goku_lite / WriteResultInfo

Function WriteResultInfo

console/controller/utils.go:70–80  ·  view source on GitHub ↗

WriteResultInfo 返回信息

(w http.ResponseWriter, resultType string, resultKey string, result interface{})

Source from the content-addressed store, hash-verified

68
69//WriteResultInfo 返回信息
70func WriteResultInfo(w http.ResponseWriter, resultType string, resultKey string, result interface{}) {
71
72 if result != nil {
73 if t := reflect.TypeOf(result); t.Kind() == reflect.Slice {
74
75 WriteResultInfoWithPage(w, resultType, resultKey, result, NewItemNum(reflect.ValueOf(result).Len()))
76 return
77 }
78 }
79 WriteResultInfoWithPage(w, resultType, resultKey, result, nil)
80}
81
82//WriteResultInfoWithCode 返回带状态信息的响应
83func WriteResultInfoWithCode(w http.ResponseWriter, code string, resultType, resultKey string, result interface{}) {

Callers 15

GetPluginListFunction · 0.92
AddPluginFunction · 0.92
EditPluginFunction · 0.92
DeletePluginFunction · 0.92
GetPluginInfoFunction · 0.92
GetPluginConfigFunction · 0.92
CheckIndexIsExistFunction · 0.92
CheckNameIsExistFunction · 0.92
StartPluginFunction · 0.92
StopPluginFunction · 0.92
BatchStopPluginFunction · 0.92

Calls 3

WriteResultInfoWithPageFunction · 0.85
NewItemNumFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected