Agent Service
     return method not found
This commit is contained in:
snoop 2017-06-09 20:04:08 +09:00
parent 8c8aa1069a
commit 973877454a

View File

@ -20,6 +20,7 @@ import (
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemCategory"
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemMapping"
"log"
"git.loafle.net/overflow/overflow_proxy_service/proxy/agent"
)
var g_services map[string]interface{}
@ -43,6 +44,7 @@ func InitServices() {
//AddServices("Agent", agent.NewAgentService())
AddServices("Member", member.NewMemberService())
AddServices("NoAuthAgent", noauthagent.NewNoAuthAgentService())
AddServices("Agent", agent.NewAgentService())
AddServices("Target", target.NewTargetService())
AddServices("Crawler", crawler.NewCrawlerService())
AddServices("CrawlerInputItem", crawlerInputItem.NewCrawlerInputItemService())
@ -67,8 +69,17 @@ func (s *ServiceImpl) ExecServices(c context.Context, in *pb.ServiceInput) (*pb.
return nil, errors.New("Not Exist Service Name")
}
pbs := &pb.ServiceOutput{}
methodName := reflect.ValueOf(serviceName).MethodByName(in.MethodName)
if methodName.IsValid() == false {
return pbs, errors.New("Not Exist Method Name")
}
params := make([]reflect.Value, methodName.Type().NumIn())
var NewObj reflect.Value