diff --git a/exercise_pool/exercise_pool.pb.go b/exercise_pool/exercise_pool.pb.go index b67f88b..2206d87 100644 --- a/exercise_pool/exercise_pool.pb.go +++ b/exercise_pool/exercise_pool.pb.go @@ -364,7 +364,7 @@ var file_exercise_pool_exercise_pool_proto_rawDesc = []byte{ 0x10, 0x0c, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x45, 0x4c, 0x54, 0x53, 0x5f, 0x53, 0x50, 0x45, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x45, 0x52, 0x43, 0x49, 0x53, 0x45, 0x10, 0x0d, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x45, 0x4c, 0x54, 0x53, 0x5f, 0x53, 0x50, 0x45, 0x41, 0x4b, 0x49, 0x4e, - 0x47, 0x5f, 0x45, 0x58, 0x41, 0x4d, 0x10, 0x0e, 0x32, 0xb9, 0x01, 0x0a, 0x13, 0x45, 0x78, 0x65, + 0x47, 0x5f, 0x45, 0x58, 0x41, 0x4d, 0x10, 0x0e, 0x32, 0x8b, 0x02, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, @@ -376,11 +376,16 @@ var file_exercise_pool_exercise_pool_proto_rawDesc = []byte{ 0x73, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x75, 0x73, 0x75, 0x6e, 0x6a, 0x79, 0x2f, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x69, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x03, 0x64, 0x65, 0x6c, 0x12, 0x22, 0x2e, 0x65, 0x78, + 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x45, 0x78, 0x65, 0x72, + 0x63, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, + 0x45, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x75, 0x73, 0x75, 0x6e, 0x6a, 0x79, 0x2f, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x69, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -409,10 +414,12 @@ var file_exercise_pool_exercise_pool_proto_depIdxs = []int32{ 1, // 2: exercise_pool.ExercisePoolResponse.items:type_name -> exercise_pool.ExerciseItem 2, // 3: exercise_pool.ExercisePoolService.get:input_type -> exercise_pool.ExercisePoolRequest 2, // 4: exercise_pool.ExercisePoolService.set:input_type -> exercise_pool.ExercisePoolRequest - 3, // 5: exercise_pool.ExercisePoolService.get:output_type -> exercise_pool.ExercisePoolResponse - 3, // 6: exercise_pool.ExercisePoolService.set:output_type -> exercise_pool.ExercisePoolResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type + 2, // 5: exercise_pool.ExercisePoolService.del:input_type -> exercise_pool.ExercisePoolRequest + 3, // 6: exercise_pool.ExercisePoolService.get:output_type -> exercise_pool.ExercisePoolResponse + 3, // 7: exercise_pool.ExercisePoolService.set:output_type -> exercise_pool.ExercisePoolResponse + 3, // 8: exercise_pool.ExercisePoolService.del:output_type -> exercise_pool.ExercisePoolResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name diff --git a/exercise_pool/exercise_pool.pb.gw.go b/exercise_pool/exercise_pool.pb.gw.go index 4bc0aea..48601e4 100644 --- a/exercise_pool/exercise_pool.pb.gw.go +++ b/exercise_pool/exercise_pool.pb.gw.go @@ -83,6 +83,32 @@ func local_request_ExercisePoolService_Set_0(ctx context.Context, marshaler runt } +func request_ExercisePoolService_Del_0(ctx context.Context, marshaler runtime.Marshaler, client ExercisePoolServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExercisePoolRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Del(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExercisePoolService_Del_0(ctx context.Context, marshaler runtime.Marshaler, server ExercisePoolServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ExercisePoolRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Del(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterExercisePoolServiceHandlerServer registers the http handlers for service ExercisePoolService to "mux". // UnaryRPC :call ExercisePoolServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -139,6 +165,31 @@ func RegisterExercisePoolServiceHandlerServer(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_ExercisePoolService_Del_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/exercise_pool.ExercisePoolService/Del", runtime.WithHTTPPathPattern("/exercise_pool.ExercisePoolService/del")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExercisePoolService_Del_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExercisePoolService_Del_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -224,6 +275,28 @@ func RegisterExercisePoolServiceHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_ExercisePoolService_Del_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/exercise_pool.ExercisePoolService/Del", runtime.WithHTTPPathPattern("/exercise_pool.ExercisePoolService/del")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExercisePoolService_Del_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExercisePoolService_Del_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -231,10 +304,14 @@ var ( pattern_ExercisePoolService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"exercise_pool.ExercisePoolService", "get"}, "")) pattern_ExercisePoolService_Set_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"exercise_pool.ExercisePoolService", "set"}, "")) + + pattern_ExercisePoolService_Del_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"exercise_pool.ExercisePoolService", "del"}, "")) ) var ( forward_ExercisePoolService_Get_0 = runtime.ForwardResponseMessage forward_ExercisePoolService_Set_0 = runtime.ForwardResponseMessage + + forward_ExercisePoolService_Del_0 = runtime.ForwardResponseMessage ) diff --git a/exercise_pool/exercise_pool.proto b/exercise_pool/exercise_pool.proto index 2cfde41..e5f80b9 100644 --- a/exercise_pool/exercise_pool.proto +++ b/exercise_pool/exercise_pool.proto @@ -43,5 +43,6 @@ message ExercisePoolResponse { service ExercisePoolService { rpc get (ExercisePoolRequest) returns (ExercisePoolResponse) {} rpc set (ExercisePoolRequest) returns (ExercisePoolResponse) {} + rpc del (ExercisePoolRequest) returns (ExercisePoolResponse) {} }; diff --git a/exercise_pool/exercise_pool_grpc.pb.go b/exercise_pool/exercise_pool_grpc.pb.go index a9f6ab1..74e13f5 100644 --- a/exercise_pool/exercise_pool_grpc.pb.go +++ b/exercise_pool/exercise_pool_grpc.pb.go @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( ExercisePoolService_Get_FullMethodName = "/exercise_pool.ExercisePoolService/get" ExercisePoolService_Set_FullMethodName = "/exercise_pool.ExercisePoolService/set" + ExercisePoolService_Del_FullMethodName = "/exercise_pool.ExercisePoolService/del" ) // ExercisePoolServiceClient is the client API for ExercisePoolService service. @@ -29,6 +30,7 @@ const ( type ExercisePoolServiceClient interface { Get(ctx context.Context, in *ExercisePoolRequest, opts ...grpc.CallOption) (*ExercisePoolResponse, error) Set(ctx context.Context, in *ExercisePoolRequest, opts ...grpc.CallOption) (*ExercisePoolResponse, error) + Del(ctx context.Context, in *ExercisePoolRequest, opts ...grpc.CallOption) (*ExercisePoolResponse, error) } type exercisePoolServiceClient struct { @@ -57,12 +59,22 @@ func (c *exercisePoolServiceClient) Set(ctx context.Context, in *ExercisePoolReq return out, nil } +func (c *exercisePoolServiceClient) Del(ctx context.Context, in *ExercisePoolRequest, opts ...grpc.CallOption) (*ExercisePoolResponse, error) { + out := new(ExercisePoolResponse) + err := c.cc.Invoke(ctx, ExercisePoolService_Del_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ExercisePoolServiceServer is the server API for ExercisePoolService service. // All implementations must embed UnimplementedExercisePoolServiceServer // for forward compatibility type ExercisePoolServiceServer interface { Get(context.Context, *ExercisePoolRequest) (*ExercisePoolResponse, error) Set(context.Context, *ExercisePoolRequest) (*ExercisePoolResponse, error) + Del(context.Context, *ExercisePoolRequest) (*ExercisePoolResponse, error) mustEmbedUnimplementedExercisePoolServiceServer() } @@ -76,6 +88,9 @@ func (UnimplementedExercisePoolServiceServer) Get(context.Context, *ExercisePool func (UnimplementedExercisePoolServiceServer) Set(context.Context, *ExercisePoolRequest) (*ExercisePoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Set not implemented") } +func (UnimplementedExercisePoolServiceServer) Del(context.Context, *ExercisePoolRequest) (*ExercisePoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Del not implemented") +} func (UnimplementedExercisePoolServiceServer) mustEmbedUnimplementedExercisePoolServiceServer() {} // UnsafeExercisePoolServiceServer may be embedded to opt out of forward compatibility for this service. @@ -125,6 +140,24 @@ func _ExercisePoolService_Set_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ExercisePoolService_Del_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExercisePoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExercisePoolServiceServer).Del(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExercisePoolService_Del_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExercisePoolServiceServer).Del(ctx, req.(*ExercisePoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ExercisePoolService_ServiceDesc is the grpc.ServiceDesc for ExercisePoolService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -140,6 +173,10 @@ var ExercisePoolService_ServiceDesc = grpc.ServiceDesc{ MethodName: "set", Handler: _ExercisePoolService_Set_Handler, }, + { + MethodName: "del", + Handler: _ExercisePoolService_Del_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exercise_pool/exercise_pool.proto",