diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-15 21:12:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-20 10:33:10 +0900 |
commit | 7937d8ddb6f8f82c593fb3b019d1fc618dc89f48 (patch) | |
tree | 853aa4860dd2a392cb7692c4b13741e2db1a0e26 /server/grpc_server.go | |
parent | 473f5b6ff32be2829dac2a19bd63df19a7efd4ec (diff) |
policy: clean up
remove redundant api structures and shorten valiable names
re-implement *ToApiStruct functions as a method of each structures
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r-- | server/grpc_server.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go index 59d1819c..16b501ec 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -269,7 +269,7 @@ func (s *Server) GetNeighborPolicy(ctx context.Context, arg *api.PolicyArguments switch arg.Resource { case api.Resource_GLOBAL: r = REQ_GLOBAL_POLICY - case api.Resource_POLICY_NEIGHBOR: + case api.Resource_LOCAL: r = REQ_NEIGHBOR_POLICY default: return nil, fmt.Errorf("unsupported resource: %s", arg.Resource) @@ -421,7 +421,7 @@ func (s *Server) GetPolicyRoutePolicies(arg *api.PolicyArguments, stream api.Gob default: return fmt.Errorf("unsupported resource type: %v", arg.Resource) } - req := NewGrpcRequest(reqType, "", rf, nil) + req := NewGrpcRequest(reqType, "", rf, arg) s.bgpServerCh <- req return handleMultipleResponses(req, func(res *GrpcResponse) error { return stream.Send(res.Data.(*api.PolicyDefinition)) @@ -447,7 +447,7 @@ func (s *Server) GetPolicyRoutePolicy(ctx context.Context, arg *api.PolicyArgume default: return nil, fmt.Errorf("unsupported resource type: %v", arg.Resource) } - req := NewGrpcRequest(reqType, "", rf, arg.Name) + req := NewGrpcRequest(reqType, "", rf, arg) s.bgpServerCh <- req res := <-req.ResponseCh |