You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
746 B
30 lines
746 B
package userCloud
|
|
|
|
import (
|
|
"fmt"
|
|
hbtp "github.com/mgr9525/HyperByte-Transfer-Protocol"
|
|
gocloud "github.com/mgr9525/go-cloud"
|
|
)
|
|
|
|
const (
|
|
RPCHostCode = 2
|
|
)
|
|
|
|
func NewReq(method string, ipr string) (*hbtp.Request, error) {
|
|
host := fmt.Sprintf("%v", gocloud.CloudConf.Custom["sysHbtpHost"])
|
|
return hbtp.NewDoRPCReq(host, RPCHostCode, method, ipr, nil)
|
|
}
|
|
func DoJson(method string, in, out interface{}, hd ...map[string]interface{}) error {
|
|
req, err := NewReq(method, "")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return hbtp.DoJson(req, in, out, hd...)
|
|
}
|
|
func DoString(method string, in interface{}, hd ...hbtp.Mp) (int, []byte, error) {
|
|
req, err := NewReq(method, "")
|
|
if err != nil {
|
|
return 0, nil, err
|
|
}
|
|
return hbtp.DoString(req, in, hd...)
|
|
}
|