kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/proto/driver.proto (about)

     1  /*
     2   * Copyright 2018 The Kythe Authors. All rights reserved.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  syntax = "proto3";
    18  
    19  import "kythe/proto/analysis.proto";
    20  import "kythe/proto/common.proto";
    21  import "kythe/proto/storage.proto";
    22  
    23  option go_package = "kythe.io/kythe/proto/driver_go_proto";
    24  
    25  // This package defines messages used to implement JSON-RPC 2.0 message
    26  // exchange between a Kythe analyzer and its pipeline driver.  These messages
    27  // are designed so that their canonical proto3 JSON encoding corresponds to the
    28  // format in the spec. The encoding rules are defined by:
    29  // https://developers.google.com/protocol-buffers/docs/proto3#json.
    30  //
    31  // Spec: https://github.com/kythe/kythe/blob/master/kythe/docs/rfc/2966.md
    32  package kythe.driver;
    33  
    34  // A request from the analyzer to establish the version of the driver protocol.
    35  message InitRequest {
    36    string protocol = 1;  // currently: "kythe1"
    37  }
    38  
    39  // A reply from the driver confirming the protocol version. The driver must
    40  // agree to use the requested protocol version, or report an error.
    41  message InitReply {
    42    string protocol = 1;
    43  }
    44  
    45  // A request from the analyzer for a compilation record to analyze.
    46  message AnalyzeRequest {
    47    // Only return a unit for analysis if its language matches.  If empty, any
    48    // available unit may be delivered.
    49    string language = 1;
    50  }
    51  
    52  // A reply from the driver delivering a compilation unit to analyze.
    53  message AnalyzeReply {
    54    // An identifier assigned by the driver, unique across all active analyses
    55    // currently in flight from this driver. This value must be set in all other
    56    // requests involving this unit.
    57    int64 id = 1;
    58  
    59    // The compilation unit to analyze.
    60    kythe.proto.CompilationUnit unit = 2;
    61  }
    62  
    63  // A request for the contents of a file.
    64  message FileRequest {
    65    int64 id = 1;
    66  
    67    // The file path and/or digest being requested. At least one of these fields
    68    // must be non-empty.
    69    string path = 2;
    70    string digest = 3;
    71  }
    72  
    73  // A reply from the driver delivering the contents of a file.
    74  message FileReply {
    75    string path = 1;
    76    string digest = 2;
    77    bytes data = 3;
    78  }
    79  
    80  // Sent as a notification by the analyzer to write output for the specified
    81  // compilation unit. The driver does not reply.
    82  message OutRequest {
    83    int64 id = 1;
    84  
    85    repeated bytes output = 2;
    86    repeated kythe.proto.Entry entries = 3;
    87  }
    88  
    89  // Sent as a notification by the analyzer to carry log messages and diagnostics
    90  // about a pending analysis.  The driver does not reply.
    91  message LogRequest {
    92    int64 id = 1;
    93    kythe.proto.common.Diagnostic message = 2;
    94  }