From a471858025f5a2e1bd96a8a7b4c20002af533dd6 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 3 Nov 2017 21:25:38 +0900 Subject: [PATCH] ing --- rpc/discovery_service.go | 43 +++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/rpc/discovery_service.go b/rpc/discovery_service.go index f1f0f68..6bc835f 100644 --- a/rpc/discovery_service.go +++ b/rpc/discovery_service.go @@ -16,8 +16,29 @@ type StartResponseParam struct { Result int } -func (ds *DiscoveryService) Start(req *StartRequestParam) (*StartResponseParam, error) { - log.Printf("DiscoveryService.Start param: Name[%s] Count[%d]", req.Name, req.Count) +// func (ds *DiscoveryService) Start(req *StartRequestParam) (*StartResponseParam, error) { +// log.Printf("DiscoveryService.Start param: Name[%s] Count[%d]", req.Name, req.Count) +// res := &StartResponseParam{} + +// res.Result = 10 + req.Count + +// return res, nil +// } + +// func (ds *DiscoveryService) Discovery(name string, req *StartRequestParam) error { +// log.Printf("DiscoveryService.Discovery param: Name[%s] req[%v]", name, req) + +// return nil +// } + +// func (ds *DiscoveryService) Discovery1(count int, name string, req *StartRequestParam) error { +// log.Printf("DiscoveryService.Discovery param: Count[%d] Name[%s] req[%v]", count, name, req) + +// return nil +// } + +func (ds *DiscoveryService) Discovery2(count int, name string, req *StartRequestParam) (*StartResponseParam, error) { + log.Printf("DiscoveryService.Discovery2 param: count[%d] name[%s] req.Name[%s] req.Count[%d]", count, name, req.Name, req.Count) res := &StartResponseParam{} res.Result = 10 + req.Count @@ -25,8 +46,20 @@ func (ds *DiscoveryService) Start(req *StartRequestParam) (*StartResponseParam, return res, nil } -func (ds *DiscoveryService) Discovery(name string, req *StartRequestParam) error { - log.Printf("DiscoveryService.Discovery param: Name[%s] req[%v]", name, req) +func (ds *DiscoveryService) Discovery3(names []string, req *StartRequestParam) (*StartResponseParam, error) { + log.Printf("DiscoveryService.Discovery3 param: names[%v] req.Name[%s] req.Count[%d]", names, req.Name, req.Count) + res := &StartResponseParam{} - return nil + res.Result = 10 + req.Count + + return res, nil +} + +func (ds *DiscoveryService) Discovery4(names map[string]string, req *StartRequestParam) (*StartResponseParam, error) { + log.Printf("DiscoveryService.Discovery4 param: names[%v] req.Name[%s] req.Count[%d]", names, req.Name, req.Count) + res := &StartResponseParam{} + + res.Result = 10 + req.Count + + return res, nil }