...

Source file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb/unannotated_echo_service.pb.gw.go

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb

     1  // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
     2  // source: examples/internal/proto/examplepb/unannotated_echo_service.proto
     3  
     4  /*
     5  Package examplepb is a reverse proxy.
     6  
     7  It translates gRPC into RESTful JSON APIs.
     8  */
     9  package examplepb
    10  
    11  import (
    12  	"context"
    13  	"io"
    14  	"net/http"
    15  
    16  	"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
    17  	"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
    18  	"google.golang.org/grpc"
    19  	"google.golang.org/grpc/codes"
    20  	"google.golang.org/grpc/grpclog"
    21  	"google.golang.org/grpc/metadata"
    22  	"google.golang.org/grpc/status"
    23  	"google.golang.org/protobuf/proto"
    24  )
    25  
    26  // Suppress "imported and not used" errors
    27  var _ codes.Code
    28  var _ io.Reader
    29  var _ status.Status
    30  var _ = runtime.String
    31  var _ = utilities.NewDoubleArray
    32  var _ = metadata.Join
    33  
    34  var (
    35  	filter_UnannotatedEchoService_Echo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
    36  )
    37  
    38  func request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    39  	var protoReq UnannotatedSimpleMessage
    40  	var metadata runtime.ServerMetadata
    41  
    42  	var (
    43  		val string
    44  		ok  bool
    45  		err error
    46  		_   = err
    47  	)
    48  
    49  	val, ok = pathParams["id"]
    50  	if !ok {
    51  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
    52  	}
    53  
    54  	protoReq.Id, err = runtime.String(val)
    55  	if err != nil {
    56  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
    57  	}
    58  
    59  	if err := req.ParseForm(); err != nil {
    60  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
    61  	}
    62  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_Echo_0); err != nil {
    63  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
    64  	}
    65  
    66  	msg, err := client.Echo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
    67  	return msg, metadata, err
    68  
    69  }
    70  
    71  func local_request_UnannotatedEchoService_Echo_0(ctx context.Context, marshaler runtime.Marshaler, server UnannotatedEchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    72  	var protoReq UnannotatedSimpleMessage
    73  	var metadata runtime.ServerMetadata
    74  
    75  	var (
    76  		val string
    77  		ok  bool
    78  		err error
    79  		_   = err
    80  	)
    81  
    82  	val, ok = pathParams["id"]
    83  	if !ok {
    84  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
    85  	}
    86  
    87  	protoReq.Id, err = runtime.String(val)
    88  	if err != nil {
    89  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
    90  	}
    91  
    92  	if err := req.ParseForm(); err != nil {
    93  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
    94  	}
    95  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_Echo_0); err != nil {
    96  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
    97  	}
    98  
    99  	msg, err := server.Echo(ctx, &protoReq)
   100  	return msg, metadata, err
   101  
   102  }
   103  
   104  var (
   105  	filter_UnannotatedEchoService_Echo_1 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0, "num": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
   106  )
   107  
   108  func request_UnannotatedEchoService_Echo_1(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   109  	var protoReq UnannotatedSimpleMessage
   110  	var metadata runtime.ServerMetadata
   111  
   112  	var (
   113  		val string
   114  		ok  bool
   115  		err error
   116  		_   = err
   117  	)
   118  
   119  	val, ok = pathParams["id"]
   120  	if !ok {
   121  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
   122  	}
   123  
   124  	protoReq.Id, err = runtime.String(val)
   125  	if err != nil {
   126  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
   127  	}
   128  
   129  	val, ok = pathParams["num"]
   130  	if !ok {
   131  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "num")
   132  	}
   133  
   134  	protoReq.Num, err = runtime.Int64(val)
   135  	if err != nil {
   136  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "num", err)
   137  	}
   138  
   139  	if err := req.ParseForm(); err != nil {
   140  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   141  	}
   142  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_Echo_1); err != nil {
   143  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   144  	}
   145  
   146  	msg, err := client.Echo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
   147  	return msg, metadata, err
   148  
   149  }
   150  
   151  func local_request_UnannotatedEchoService_Echo_1(ctx context.Context, marshaler runtime.Marshaler, server UnannotatedEchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   152  	var protoReq UnannotatedSimpleMessage
   153  	var metadata runtime.ServerMetadata
   154  
   155  	var (
   156  		val string
   157  		ok  bool
   158  		err error
   159  		_   = err
   160  	)
   161  
   162  	val, ok = pathParams["id"]
   163  	if !ok {
   164  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
   165  	}
   166  
   167  	protoReq.Id, err = runtime.String(val)
   168  	if err != nil {
   169  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
   170  	}
   171  
   172  	val, ok = pathParams["num"]
   173  	if !ok {
   174  		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "num")
   175  	}
   176  
   177  	protoReq.Num, err = runtime.Int64(val)
   178  	if err != nil {
   179  		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "num", err)
   180  	}
   181  
   182  	if err := req.ParseForm(); err != nil {
   183  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   184  	}
   185  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_Echo_1); err != nil {
   186  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   187  	}
   188  
   189  	msg, err := server.Echo(ctx, &protoReq)
   190  	return msg, metadata, err
   191  
   192  }
   193  
   194  func request_UnannotatedEchoService_EchoBody_0(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   195  	var protoReq UnannotatedSimpleMessage
   196  	var metadata runtime.ServerMetadata
   197  
   198  	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
   199  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   200  	}
   201  
   202  	msg, err := client.EchoBody(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
   203  	return msg, metadata, err
   204  
   205  }
   206  
   207  func local_request_UnannotatedEchoService_EchoBody_0(ctx context.Context, marshaler runtime.Marshaler, server UnannotatedEchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   208  	var protoReq UnannotatedSimpleMessage
   209  	var metadata runtime.ServerMetadata
   210  
   211  	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
   212  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   213  	}
   214  
   215  	msg, err := server.EchoBody(ctx, &protoReq)
   216  	return msg, metadata, err
   217  
   218  }
   219  
   220  var (
   221  	filter_UnannotatedEchoService_EchoDelete_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
   222  )
   223  
   224  func request_UnannotatedEchoService_EchoDelete_0(ctx context.Context, marshaler runtime.Marshaler, client UnannotatedEchoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   225  	var protoReq UnannotatedSimpleMessage
   226  	var metadata runtime.ServerMetadata
   227  
   228  	if err := req.ParseForm(); err != nil {
   229  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   230  	}
   231  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_EchoDelete_0); err != nil {
   232  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   233  	}
   234  
   235  	msg, err := client.EchoDelete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
   236  	return msg, metadata, err
   237  
   238  }
   239  
   240  func local_request_UnannotatedEchoService_EchoDelete_0(ctx context.Context, marshaler runtime.Marshaler, server UnannotatedEchoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
   241  	var protoReq UnannotatedSimpleMessage
   242  	var metadata runtime.ServerMetadata
   243  
   244  	if err := req.ParseForm(); err != nil {
   245  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   246  	}
   247  	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UnannotatedEchoService_EchoDelete_0); err != nil {
   248  		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
   249  	}
   250  
   251  	msg, err := server.EchoDelete(ctx, &protoReq)
   252  	return msg, metadata, err
   253  
   254  }
   255  
   256  // RegisterUnannotatedEchoServiceHandlerServer registers the http handlers for service UnannotatedEchoService to "mux".
   257  // UnaryRPC     :call UnannotatedEchoServiceServer directly.
   258  // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
   259  // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUnannotatedEchoServiceHandlerFromEndpoint instead.
   260  func RegisterUnannotatedEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UnannotatedEchoServiceServer) error {
   261  
   262  	mux.Handle("POST", pattern_UnannotatedEchoService_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   263  		ctx, cancel := context.WithCancel(req.Context())
   264  		defer cancel()
   265  		var stream runtime.ServerTransportStream
   266  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   267  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   268  		var err error
   269  		var annotatedContext context.Context
   270  		annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/{id}"))
   271  		if err != nil {
   272  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   273  			return
   274  		}
   275  		resp, md, err := local_request_UnannotatedEchoService_Echo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
   276  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   277  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   278  		if err != nil {
   279  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   280  			return
   281  		}
   282  
   283  		forward_UnannotatedEchoService_Echo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   284  
   285  	})
   286  
   287  	mux.Handle("GET", pattern_UnannotatedEchoService_Echo_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   288  		ctx, cancel := context.WithCancel(req.Context())
   289  		defer cancel()
   290  		var stream runtime.ServerTransportStream
   291  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   292  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   293  		var err error
   294  		var annotatedContext context.Context
   295  		annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/{id}/{num}"))
   296  		if err != nil {
   297  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   298  			return
   299  		}
   300  		resp, md, err := local_request_UnannotatedEchoService_Echo_1(annotatedContext, inboundMarshaler, server, req, pathParams)
   301  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   302  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   303  		if err != nil {
   304  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   305  			return
   306  		}
   307  
   308  		forward_UnannotatedEchoService_Echo_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   309  
   310  	})
   311  
   312  	mux.Handle("POST", pattern_UnannotatedEchoService_EchoBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   313  		ctx, cancel := context.WithCancel(req.Context())
   314  		defer cancel()
   315  		var stream runtime.ServerTransportStream
   316  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   317  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   318  		var err error
   319  		var annotatedContext context.Context
   320  		annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/EchoBody", runtime.WithHTTPPathPattern("/v1/example/echo_body"))
   321  		if err != nil {
   322  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   323  			return
   324  		}
   325  		resp, md, err := local_request_UnannotatedEchoService_EchoBody_0(annotatedContext, inboundMarshaler, server, req, pathParams)
   326  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   327  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   328  		if err != nil {
   329  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   330  			return
   331  		}
   332  
   333  		forward_UnannotatedEchoService_EchoBody_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   334  
   335  	})
   336  
   337  	mux.Handle("DELETE", pattern_UnannotatedEchoService_EchoDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   338  		ctx, cancel := context.WithCancel(req.Context())
   339  		defer cancel()
   340  		var stream runtime.ServerTransportStream
   341  		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
   342  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   343  		var err error
   344  		var annotatedContext context.Context
   345  		annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/EchoDelete", runtime.WithHTTPPathPattern("/v1/example/echo_delete"))
   346  		if err != nil {
   347  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   348  			return
   349  		}
   350  		resp, md, err := local_request_UnannotatedEchoService_EchoDelete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
   351  		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
   352  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   353  		if err != nil {
   354  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   355  			return
   356  		}
   357  
   358  		forward_UnannotatedEchoService_EchoDelete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   359  
   360  	})
   361  
   362  	return nil
   363  }
   364  
   365  // RegisterUnannotatedEchoServiceHandlerFromEndpoint is same as RegisterUnannotatedEchoServiceHandler but
   366  // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
   367  func RegisterUnannotatedEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
   368  	conn, err := grpc.DialContext(ctx, endpoint, opts...)
   369  	if err != nil {
   370  		return err
   371  	}
   372  	defer func() {
   373  		if err != nil {
   374  			if cerr := conn.Close(); cerr != nil {
   375  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
   376  			}
   377  			return
   378  		}
   379  		go func() {
   380  			<-ctx.Done()
   381  			if cerr := conn.Close(); cerr != nil {
   382  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
   383  			}
   384  		}()
   385  	}()
   386  
   387  	return RegisterUnannotatedEchoServiceHandler(ctx, mux, conn)
   388  }
   389  
   390  // RegisterUnannotatedEchoServiceHandler registers the http handlers for service UnannotatedEchoService to "mux".
   391  // The handlers forward requests to the grpc endpoint over "conn".
   392  func RegisterUnannotatedEchoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
   393  	return RegisterUnannotatedEchoServiceHandlerClient(ctx, mux, NewUnannotatedEchoServiceClient(conn))
   394  }
   395  
   396  // RegisterUnannotatedEchoServiceHandlerClient registers the http handlers for service UnannotatedEchoService
   397  // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UnannotatedEchoServiceClient".
   398  // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UnannotatedEchoServiceClient"
   399  // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
   400  // "UnannotatedEchoServiceClient" to call the correct interceptors.
   401  func RegisterUnannotatedEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UnannotatedEchoServiceClient) error {
   402  
   403  	mux.Handle("POST", pattern_UnannotatedEchoService_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   404  		ctx, cancel := context.WithCancel(req.Context())
   405  		defer cancel()
   406  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   407  		var err error
   408  		var annotatedContext context.Context
   409  		annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/{id}"))
   410  		if err != nil {
   411  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   412  			return
   413  		}
   414  		resp, md, err := request_UnannotatedEchoService_Echo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
   415  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   416  		if err != nil {
   417  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   418  			return
   419  		}
   420  
   421  		forward_UnannotatedEchoService_Echo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   422  
   423  	})
   424  
   425  	mux.Handle("GET", pattern_UnannotatedEchoService_Echo_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   426  		ctx, cancel := context.WithCancel(req.Context())
   427  		defer cancel()
   428  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   429  		var err error
   430  		var annotatedContext context.Context
   431  		annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/Echo", runtime.WithHTTPPathPattern("/v1/example/echo/{id}/{num}"))
   432  		if err != nil {
   433  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   434  			return
   435  		}
   436  		resp, md, err := request_UnannotatedEchoService_Echo_1(annotatedContext, inboundMarshaler, client, req, pathParams)
   437  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   438  		if err != nil {
   439  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   440  			return
   441  		}
   442  
   443  		forward_UnannotatedEchoService_Echo_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   444  
   445  	})
   446  
   447  	mux.Handle("POST", pattern_UnannotatedEchoService_EchoBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   448  		ctx, cancel := context.WithCancel(req.Context())
   449  		defer cancel()
   450  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   451  		var err error
   452  		var annotatedContext context.Context
   453  		annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/EchoBody", runtime.WithHTTPPathPattern("/v1/example/echo_body"))
   454  		if err != nil {
   455  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   456  			return
   457  		}
   458  		resp, md, err := request_UnannotatedEchoService_EchoBody_0(annotatedContext, inboundMarshaler, client, req, pathParams)
   459  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   460  		if err != nil {
   461  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   462  			return
   463  		}
   464  
   465  		forward_UnannotatedEchoService_EchoBody_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   466  
   467  	})
   468  
   469  	mux.Handle("DELETE", pattern_UnannotatedEchoService_EchoDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   470  		ctx, cancel := context.WithCancel(req.Context())
   471  		defer cancel()
   472  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   473  		var err error
   474  		var annotatedContext context.Context
   475  		annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/grpc.gateway.examples.internal.proto.examplepb.UnannotatedEchoService/EchoDelete", runtime.WithHTTPPathPattern("/v1/example/echo_delete"))
   476  		if err != nil {
   477  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   478  			return
   479  		}
   480  		resp, md, err := request_UnannotatedEchoService_EchoDelete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
   481  		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
   482  		if err != nil {
   483  			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
   484  			return
   485  		}
   486  
   487  		forward_UnannotatedEchoService_EchoDelete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   488  
   489  	})
   490  
   491  	return nil
   492  }
   493  
   494  var (
   495  	pattern_UnannotatedEchoService_Echo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo", "id"}, ""))
   496  
   497  	pattern_UnannotatedEchoService_Echo_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "example", "echo", "id", "num"}, ""))
   498  
   499  	pattern_UnannotatedEchoService_EchoBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_body"}, ""))
   500  
   501  	pattern_UnannotatedEchoService_EchoDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_delete"}, ""))
   502  )
   503  
   504  var (
   505  	forward_UnannotatedEchoService_Echo_0 = runtime.ForwardResponseMessage
   506  
   507  	forward_UnannotatedEchoService_Echo_1 = runtime.ForwardResponseMessage
   508  
   509  	forward_UnannotatedEchoService_EchoBody_0 = runtime.ForwardResponseMessage
   510  
   511  	forward_UnannotatedEchoService_EchoDelete_0 = runtime.ForwardResponseMessage
   512  )
   513  

View as plain text