package userCloud import ( "fmt" hbtp "github.com/mgr9525/HyperByte-Transfer-Protocol" gocloud "github.com/mgr9525/go-cloud" "net/url" "time" ) const ( RPCHostCode = 2 ) func NewReq(cmds string, iprs string, tmots ...time.Duration) *hbtp.Request { host := fmt.Sprintf("%v", gocloud.CloudConf.Custom["sysHbtpHost"]) pars := url.Values{} pars.Set("iprs", iprs) return hbtp.NewRequest(host, RPCHostCode, tmots...).Command(cmds).Args(pars) } func DoJson(cmds string, in, out interface{}, hd ...hbtp.Map) error { req := NewReq(cmds, "") return hbtp.DoJson(req, in, out, hd...) } func DoString(cmds string, in interface{}, hd ...hbtp.Map) (int32, []byte, error) { req := NewReq(cmds, "") return hbtp.DoString(req, in, hd...) }