|
@@ -21,6 +21,19 @@ var (
|
|
|
|
|
|
|
|
type H map[string]interface{}
|
|
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 {
|
|
func ErrForCode(code int) error {
|
|
|
return errors.New(fmt.Sprintf("returned error code: %v", code))
|
|
return errors.New(fmt.Sprintf("returned error code: %v", code))
|
|
|
}
|
|
}
|