kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/proto/internal.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.internal;
    20  
    21  option go_package = "kythe.io/kythe/proto/internal_go_proto";
    22  option java_package = "com.google.devtools.kythe.proto";
    23  
    24  import "kythe/proto/serving.proto";
    25  
    26  // Source is a collection of facts and edges with a common source.
    27  message Source {
    28    message Edge {
    29      // Target ticket of the edge
    30      string ticket = 1;
    31      // Ordinal of the edge
    32      int32 ordinal = 2;
    33    }
    34  
    35    message EdgeGroup {
    36      // Set of Edges sharing the same kind and source
    37      repeated Edge edges = 1;
    38    }
    39  
    40    // Ticket of the source node
    41    string ticket = 1;
    42  
    43    // Fact name -> fact value
    44    map<string, bytes> facts = 2;
    45  
    46    // Edge kind -> EdgeGroup
    47    map<string, EdgeGroup> edge_groups = 3;
    48  }
    49  
    50  // Internal encoding for an EdgesReply/CrossReferencesReply page_token
    51  message PageToken {
    52    // Index into the primary reply sequence.
    53    int32 index = 1;
    54    // Secondary page tokens for reply sub-queries.
    55    repeated string secondary_token = 2;
    56  
    57    // Map of named page tokens for sub-queries.
    58    map<string, string> sub_tokens = 3;
    59    // Map of named indices into a paged sequence.
    60    map<string, int32> indices = 4;
    61  }
    62  
    63  // A CrossReference represents a path between two anchors, crossing between a
    64  // single common node.  Abstractly this a
    65  // (file, anchor, kind, node, kind', anchor', file') tuple where the two
    66  // (file, anchor, kind) sub-components have been named Decorations.
    67  //
    68  // This structure can be used to represent the intermediary* structures needed
    69  // to build pre-cached responses to the Decorations and CrossReferences service
    70  // methods.
    71  //
    72  // * where only a subset of this structure is known at that moment in time
    73  message CrossReference {
    74    // A Decoration is specialized partial edge with an anchor on one end, stored
    75    // along side its parent file node.  The partial edge's other end is stored in
    76    // the referent field of the parent CrossReference.
    77    message Decoration {
    78      kythe.proto.serving.File file = 1;
    79      kythe.proto.serving.RawAnchor anchor = 2;
    80      string kind = 3;
    81    }
    82  
    83    Decoration source_decoration = 1;
    84    kythe.proto.serving.Node referent = 2;
    85    Decoration target_decoration = 3;
    86  
    87    kythe.proto.serving.ExpandedAnchor source_anchor = 4;
    88    kythe.proto.serving.ExpandedAnchor target_anchor = 5;
    89  }
    90  
    91  message SortedKeyValue {
    92    string key = 1;
    93    string sort_key = 2;
    94    bytes value = 3;
    95  }
    96  
    97  // A Path represents a chain of Kythe edges starting from a particular node
    98  // known as the Path's pivot node.
    99  //
   100  // Example Path representing a FileDecorations_Decoration:
   101  //    pivot: <
   102  //      file: <
   103  //        ticket:
   104  //        "kythe://kythe?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java"
   105  //        text: "..."
   106  //        encoding: "UTF-8"
   107  //      >
   108  //      ticket:
   109  //      "kythe://kythe?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java"
   110  //      node_kind: "file"
   111  //    >
   112  //    edges: <
   113  //      kind: "%/kythe/edge/childof"
   114  //      target: <
   115  //        expanded_anchor: <
   116  //          ticket:
   117  //          "kythe://kythe?lang=java?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java#b2b44a5e5d4b7f521b192a99ab6172ad24bf055db0c3e6353775a31f83e4e8b9"
   118  //          kind: "%/kythe/edge/childof"
   119  //          parent:
   120  //          "kythe://kythe?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java"
   121  //          text: "edgeOrdinal"
   122  //          span: <...>
   123  //          snippet: "this.edgeOrdinal = -1"
   124  //          snippet_span: <...>
   125  //        >
   126  //        ticket:
   127  //        "kythe://kythe?lang=java?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java#b2b44a5e5d4b7f521b192a99ab6172ad24bf055db0c3e6353775a31f83e4e8b9"
   128  //        node_kind: "anchor"
   129  //      >
   130  //    >
   131  //    edges: <
   132  //      kind: "/kythe/edge/ref"
   133  //      target: <
   134  //        ticket:
   135  //        "kythe://kythe?lang=java?path=kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java#3397da0c78948141fc85aa634e6d42e4461968ad33409c104e3a5e566306b8c5"
   136  //        node_kind: "variable"
   137  //        original: <...>
   138  //      >
   139  //    >
   140  message Path {
   141    // A serving node with a possible specialization that unwraps/parses the
   142    // original node's facts.
   143    message Node {
   144      oneof specialization {
   145        kythe.proto.serving.RawAnchor raw_anchor = 10;
   146        kythe.proto.serving.ExpandedAnchor expanded_anchor = 11;
   147        kythe.proto.serving.File file = 12;
   148      }
   149  
   150      string ticket = 1;
   151      string node_kind = 2;
   152  
   153      kythe.proto.serving.Node original = 3;
   154    }
   155  
   156    message Edge {
   157      string kind = 1;
   158      int32 ordinal = 2;
   159      Node target = 3;
   160    }
   161  
   162    // The central node of this Path.
   163    Node pivot = 1;
   164  
   165    // A sequence of edges leading from the pivot node.
   166    repeated Edge edges = 2;
   167  }