Exemplo n.º 1
0
func CallC(rc *impl.RCM_Cmd) (interface{}, error) {
	var cid = rc.Kvs().StrVal("cid")
	log.D("run_rc_s doing call_c by cid(%v)", cid)
	var cmd = rcs.CmdC(cid)
	if cmd == nil {
		return util.Map{
			"code": -1,
			"err":  "not found",
		}, nil
	}
	var name = rc.StrVal("name")
	var args = rc.MapVal("args")
	log.D("run_rc_s call client by name(%v),args(%v)", name, util.S2Json(args))
	var res, err = cmd.Exec_m(name, args)
	log.D("run_rc_s call client result->%v", util.S2Json(res))
	return res, err
}
Exemplo n.º 2
0
func Args_s(rc *impl.RCM_Cmd) (interface{}, error) {
	log.D("run_rc_s doing Args_s->%v", string(rc.Data()))
	return rc.StrVal("val"), nil
}