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.
 
 
 

28 lines
738 B

package commCloud
import (
"fmt"
hbtp "github.com/mgr9525/HyperByte-Transfer-Protocol"
gocloud "github.com/mgr9525/go-cloud"
"net/url"
"time"
)
const (
RPCHostCode = 1
)
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...)
}