From ecdab23b72f154d6e6efa74abf06574526121fd4 Mon Sep 17 00:00:00 2001 From: Vissa Janardhan Krishna Sai Date: Fri, 20 Dec 2024 09:55:48 +0000 Subject: [PATCH] renaming client and server handlers --- authz/grpc_authz_end2end_test.go | 4 ++-- internal/stubserver/stubserver.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/authz/grpc_authz_end2end_test.go b/authz/grpc_authz_end2end_test.go index 45dcc30f69f9..4c0340111cd8 100644 --- a/authz/grpc_authz_end2end_test.go +++ b/authz/grpc_authz_end2end_test.go @@ -304,7 +304,7 @@ func (s) TestStaticPolicyEnd2End(t *testing.T) { UnaryCallF: func(ctx context.Context, req *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { return &testpb.SimpleResponse{}, nil }, - ClientStreamingInputCall: func(stream testgrpc.TestService_StreamingInputCallServer) error { + StreamingInputCallF: func(stream testgrpc.TestService_StreamingInputCallServer) error { for { _, err := stream.Recv() if err == io.EOF { @@ -518,7 +518,7 @@ func (s) TestFileWatcherEnd2End(t *testing.T) { UnaryCallF: func(ctx context.Context, req *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { return &testpb.SimpleResponse{}, nil }, - ClientStreamingInputCall: func(stream testgrpc.TestService_StreamingInputCallServer) error { + StreamingInputCallF: func(stream testgrpc.TestService_StreamingInputCallServer) error { for { _, err := stream.Recv() if err == io.EOF { diff --git a/internal/stubserver/stubserver.go b/internal/stubserver/stubserver.go index a9d766a31a39..1c92793d8df6 100644 --- a/internal/stubserver/stubserver.go +++ b/internal/stubserver/stubserver.go @@ -56,11 +56,11 @@ type StubServer struct { testgrpc.TestServiceServer // Customizable implementations of server handlers. - EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) - UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) - FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error - ClientStreamingInputCall func(stream testgrpc.TestService_StreamingInputCallServer) error - ClientStreamingOutputCall func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error + EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) + UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) + FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error + StreamingInputCallF func(stream testgrpc.TestService_StreamingInputCallServer) error // ClientStreaming + StreamingOutputCallF func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error // ServerStreaming // A client connected to this service the test may use. Created in Start(). Client testgrpc.TestServiceClient @@ -105,12 +105,12 @@ func (ss *StubServer) FullDuplexCall(stream testgrpc.TestService_FullDuplexCallS // StreamingInputCall is the handler for testpb.StreamingInputCall func (ss *StubServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error { - return ss.ClientStreamingInputCall(stream) + return ss.StreamingInputCallF(stream) } // StreamingOutputCall is the handler for testpb.StreamingOutputCall func (ss *StubServer) StreamingOutputCall(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error { - return ss.ClientStreamingOutputCall(req, stream) + return ss.StreamingOutputCallF(req, stream) } // Start starts the server and creates a client connected to it.