Bladeren bron

add JsReq JsResp structs

joe 4 jaren geleden
bovenliggende
commit
264b56a4ea
1 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  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))
 }