dubbo.apache.org/dubbo-go/v3@v3.1.1/protocol/dubbo3/reflection/triple_reflection_v1alpha/reflection.proto (about)

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