/*
 * Copyright 2015 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

package kythe.proto;
option java_package = "com.google.devtools.kythe.proto";

// FileTreeService provides an interface to explore a tree of files.
service FileTreeService {
  // CorpusRoots returns all known corpus/root pairs for stored files.
  rpc CorpusRoots(CorpusRootsRequest) returns (CorpusRootsReply) {}

  // Directory returns the file/sub-directory contents of the given directory.
  rpc Directory(DirectoryRequest) returns (DirectoryReply) {}
}

message CorpusRootsRequest {}

message CorpusRootsReply {
  message Corpus {
    string name = 1;
    repeated string root = 2;
  }
  repeated Corpus corpus = 1;
}

message DirectoryRequest {
  string corpus = 1;
  string root = 2;
  string path = 3;
}

message DirectoryReply {
  // Set of tickets for each contained sub-directory's corpus, root, and path.
  repeated string subdirectory = 1;

  // Set of file tickets contained within this directory.
  repeated string file = 2;
}