github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/grpc/reflection/grpc_reflection_v1alpha/reflection.proto (about)

     1  // Copyright 2016 gRPC authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Service exported by server reflection
    16  
    17  syntax = "proto3";
    18  
    19  option go_package = "github.com/hxx258456/ccgo/grpc/reflection/grpc_reflection_v1alpha";
    20  
    21  package grpc.reflection.v1alpha;
    22  
    23  service ServerReflection {
    24    // The reflection service is structured as a bidirectional stream, ensuring
    25    // all related requests go to a single server.
    26    rpc ServerReflectionInfo(stream ServerReflectionRequest)
    27        returns (stream ServerReflectionResponse);
    28  }
    29  
    30  // The message sent by the client when calling ServerReflectionInfo method.
    31  message ServerReflectionRequest {
    32    string host = 1;
    33    // To use reflection service, the client should set one of the following
    34    // fields in message_request. The server distinguishes requests by their
    35    // defined field and then handles them using corresponding methods.
    36    oneof message_request {
    37      // Find a proto file by the file name.
    38      string file_by_filename = 3;
    39  
    40      // Find the proto file that declares the given fully-qualified symbol name.
    41      // This field should be a fully-qualified symbol name
    42      // (e.g. <package>.<service>[.<method>] or <package>.<type>).
    43      string file_containing_symbol = 4;
    44  
    45      // Find the proto file which defines an extension extending the given
    46      // message type with the given field number.
    47      ExtensionRequest file_containing_extension = 5;
    48  
    49      // Finds the tag numbers used by all known extensions of extendee_type, and
    50      // appends them to ExtensionNumberResponse in an undefined order.
    51      // Its corresponding method is best-effort: it's not guaranteed that the
    52      // reflection service will implement this method, and it's not guaranteed
    53      // that this method will provide all extensions. Returns
    54      // StatusCode::UNIMPLEMENTED if it's not implemented.
    55      // This field should be a fully-qualified type name. The format is
    56      // <package>.<type>
    57      string all_extension_numbers_of_type = 6;
    58  
    59      // List the full names of registered services. The content will not be
    60      // checked.
    61      string list_services = 7;
    62    }
    63  }
    64  
    65  // The type name and extension number sent by the client when requesting
    66  // file_containing_extension.
    67  message ExtensionRequest {
    68    // Fully-qualified type name. The format should be <package>.<type>
    69    string containing_type = 1;
    70    int32 extension_number = 2;
    71  }
    72  
    73  // The message sent by the server to answer ServerReflectionInfo method.
    74  message ServerReflectionResponse {
    75    string valid_host = 1;
    76    ServerReflectionRequest original_request = 2;
    77    // The server sets one of the following fields according to the
    78    // message_request in the request.
    79    oneof message_response {
    80      // This message is used to answer file_by_filename, file_containing_symbol,
    81      // file_containing_extension requests with transitive dependencies.
    82      // As the repeated label is not allowed in oneof fields, we use a
    83      // FileDescriptorResponse message to encapsulate the repeated fields.
    84      // The reflection service is allowed to avoid sending FileDescriptorProtos
    85      // that were previously sent in response to earlier requests in the stream.
    86      FileDescriptorResponse file_descriptor_response = 4;
    87  
    88      // This message is used to answer all_extension_numbers_of_type requests.
    89      ExtensionNumberResponse all_extension_numbers_response = 5;
    90  
    91      // This message is used to answer list_services requests.
    92      ListServiceResponse list_services_response = 6;
    93  
    94      // This message is used when an error occurs.
    95      ErrorResponse error_response = 7;
    96    }
    97  }
    98  
    99  // Serialized FileDescriptorProto messages sent by the server answering
   100  // a file_by_filename, file_containing_symbol, or file_containing_extension
   101  // request.
   102  message FileDescriptorResponse {
   103    // Serialized FileDescriptorProto messages. We avoid taking a dependency on
   104    // descriptor.proto, which uses proto2 only features, by making them opaque
   105    // bytes instead.
   106    repeated bytes file_descriptor_proto = 1;
   107  }
   108  
   109  // A list of extension numbers sent by the server answering
   110  // all_extension_numbers_of_type request.
   111  message ExtensionNumberResponse {
   112    // Full name of the base type, including the package name. The format
   113    // is <package>.<type>
   114    string base_type_name = 1;
   115    repeated int32 extension_number = 2;
   116  }
   117  
   118  // A list of ServiceResponse sent by the server answering list_services request.
   119  message ListServiceResponse {
   120    // The information of each service may be expanded in the future, so we use
   121    // ServiceResponse message to encapsulate it.
   122    repeated ServiceResponse service = 1;
   123  }
   124  
   125  // The information of a single service used by ListServiceResponse to answer
   126  // list_services request.
   127  message ServiceResponse {
   128    // Full name of a registered service, including its package name. The format
   129    // is <package>.<service>
   130    string name = 1;
   131  }
   132  
   133  // The error code and error message sent by the server when an error occurs.
   134  message ErrorResponse {
   135    // This field uses the error codes defined in grpc::StatusCode.
   136    int32 error_code = 1;
   137    string error_message = 2;
   138  }