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

     1  /*
     2   * Copyright 2016 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  package kythe.proto;
    20  
    21  option go_package = "kythe.io/kythe/proto/analysis_service_go_proto";
    22  option java_package = "com.google.devtools.kythe.proto";
    23  
    24  import "kythe/proto/analysis.proto";
    25  
    26  // CompilationAnalyzer services are exposed by any program that wants to plug
    27  // into the Kythe pipeline to perform per-compilation analysis.
    28  service CompilationAnalyzer {
    29    // Analyze is the main entry point for the analysis driver to send work to the
    30    // analyzer.  The analysis may produce many outputs which will be streamed as
    31    // framed AnalysisOutput messages.
    32    //
    33    // A driver may choose to retry analyses that return RPC errors.  It should
    34    // not retry analyses that are reported as finished unless it is necessary to
    35    // recover from an external production issue.
    36    //
    37    // If the RPC implementation does not support out-of-band error messages, the
    38    // analyzer may report status by setting the final_result field of its last
    39    // AnalysisOutput message.
    40    rpc Analyze(AnalysisRequest) returns (stream AnalysisOutput) {}
    41  }
    42  
    43  // FileDataServices are used by a CompilationAnalyzer to retrieve the contents
    44  // of input files required for analysis.
    45  service FileDataService {
    46    // Get returns the contents of one or more files needed for analysis.  It is
    47    // the server's responsibility to do any caching necessary to make this
    48    // perform well, so that an analyzer does not need to implement its own
    49    // caches unless it is doing something unusual.
    50    //
    51    // For each distinct path/digest pair in the request, the server must return
    52    // exactly one response.  The order of the responses is arbitrary.
    53    //
    54    // For each requested file, one or both of the path and digest fields must be
    55    // nonempty, otherwise an error is returned.  It is not an error for there to
    56    // be no requested files, however.
    57    rpc Get(FilesRequest) returns (stream FileData) {}
    58  
    59    // GetFileData returns the contents a file needed for analysis.  It is the
    60    // server's responsibility to do any caching necessary to make this perform
    61    // well, so that an analyzer does not need to implement its own caches unless
    62    // it is doing something unusual.
    63    //
    64    // One or both of the path and digest fields must be nonempty, otherwise an
    65    // error is returned.
    66    rpc GetFileData(FileInfo) returns (FileData) {}
    67  }