Explorar o código

add JsReq JsResp structs

joe %!s(int64=4) %!d(string=hai) anos
pai
achega
264b56a4ea
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      utl/common.go

+ 13 - 0
utl/common.go

@@ -21,6 +21,19 @@ var (
 
 type H map[string]interface{}
 
+type JsReq struct {
+	Cmd    string      `json:"cmd"`
+	Seq    int64       `json:"seq"`
+	Params interface{} `json:"params"`
+}
+
+type JsResp struct {
+	Cmd    string      `json:"cmd"`
+	Seq    int64       `json:"seq"`
+	Ec     int         `json:"ec"`
+	Result interface{} `json:"result"`
+}
+
 func ErrForCode(code int) error {
 	return errors.New(fmt.Sprintf("returned error code: %v", code))
 }