github.com/argoproj/argo-cd@v1.8.7/pkg/apiclient/settings/settings.pb.gw.go (about)

     1  // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
     2  // source: server/settings/settings.proto
     3  
     4  /*
     5  Package settings is a reverse proxy.
     6  
     7  It translates gRPC into RESTful JSON APIs.
     8  */
     9  package settings
    10  
    11  import (
    12  	"context"
    13  	"io"
    14  	"net/http"
    15  
    16  	"github.com/golang/protobuf/descriptor"
    17  	"github.com/golang/protobuf/proto"
    18  	"github.com/grpc-ecosystem/grpc-gateway/runtime"
    19  	"github.com/grpc-ecosystem/grpc-gateway/utilities"
    20  	"google.golang.org/grpc"
    21  	"google.golang.org/grpc/codes"
    22  	"google.golang.org/grpc/grpclog"
    23  	"google.golang.org/grpc/status"
    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 _ = descriptor.ForMessage
    33  
    34  func request_SettingsService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client SettingsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    35  	var protoReq SettingsQuery
    36  	var metadata runtime.ServerMetadata
    37  
    38  	msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
    39  	return msg, metadata, err
    40  
    41  }
    42  
    43  func local_request_SettingsService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server SettingsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
    44  	var protoReq SettingsQuery
    45  	var metadata runtime.ServerMetadata
    46  
    47  	msg, err := server.Get(ctx, &protoReq)
    48  	return msg, metadata, err
    49  
    50  }
    51  
    52  // RegisterSettingsServiceHandlerServer registers the http handlers for service SettingsService to "mux".
    53  // UnaryRPC     :call SettingsServiceServer directly.
    54  // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
    55  func RegisterSettingsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SettingsServiceServer) error {
    56  
    57  	mux.Handle("GET", pattern_SettingsService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
    58  		ctx, cancel := context.WithCancel(req.Context())
    59  		defer cancel()
    60  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
    61  		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
    62  		if err != nil {
    63  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
    64  			return
    65  		}
    66  		resp, md, err := local_request_SettingsService_Get_0(rctx, inboundMarshaler, server, req, pathParams)
    67  		ctx = runtime.NewServerMetadataContext(ctx, md)
    68  		if err != nil {
    69  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
    70  			return
    71  		}
    72  
    73  		forward_SettingsService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
    74  
    75  	})
    76  
    77  	return nil
    78  }
    79  
    80  // RegisterSettingsServiceHandlerFromEndpoint is same as RegisterSettingsServiceHandler but
    81  // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
    82  func RegisterSettingsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
    83  	conn, err := grpc.Dial(endpoint, opts...)
    84  	if err != nil {
    85  		return err
    86  	}
    87  	defer func() {
    88  		if err != nil {
    89  			if cerr := conn.Close(); cerr != nil {
    90  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
    91  			}
    92  			return
    93  		}
    94  		go func() {
    95  			<-ctx.Done()
    96  			if cerr := conn.Close(); cerr != nil {
    97  				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
    98  			}
    99  		}()
   100  	}()
   101  
   102  	return RegisterSettingsServiceHandler(ctx, mux, conn)
   103  }
   104  
   105  // RegisterSettingsServiceHandler registers the http handlers for service SettingsService to "mux".
   106  // The handlers forward requests to the grpc endpoint over "conn".
   107  func RegisterSettingsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
   108  	return RegisterSettingsServiceHandlerClient(ctx, mux, NewSettingsServiceClient(conn))
   109  }
   110  
   111  // RegisterSettingsServiceHandlerClient registers the http handlers for service SettingsService
   112  // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SettingsServiceClient".
   113  // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SettingsServiceClient"
   114  // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
   115  // "SettingsServiceClient" to call the correct interceptors.
   116  func RegisterSettingsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SettingsServiceClient) error {
   117  
   118  	mux.Handle("GET", pattern_SettingsService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
   119  		ctx, cancel := context.WithCancel(req.Context())
   120  		defer cancel()
   121  		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
   122  		rctx, err := runtime.AnnotateContext(ctx, mux, req)
   123  		if err != nil {
   124  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   125  			return
   126  		}
   127  		resp, md, err := request_SettingsService_Get_0(rctx, inboundMarshaler, client, req, pathParams)
   128  		ctx = runtime.NewServerMetadataContext(ctx, md)
   129  		if err != nil {
   130  			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
   131  			return
   132  		}
   133  
   134  		forward_SettingsService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
   135  
   136  	})
   137  
   138  	return nil
   139  }
   140  
   141  var (
   142  	pattern_SettingsService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "settings"}, "", runtime.AssumeColonVerbOpt(true)))
   143  )
   144  
   145  var (
   146  	forward_SettingsService_Get_0 = runtime.ForwardResponseMessage
   147  )