file.proto 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.devtools.resultstore.v2;
  16. import "google/protobuf/wrappers.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "FileProto";
  20. option java_package = "com.google.devtools.resultstore.v2";
  21. // The metadata for a file or an archive file entry.
  22. message File {
  23. // If known, the hash function used to compute this digest.
  24. enum HashType {
  25. // Unknown
  26. HASH_TYPE_UNSPECIFIED = 0;
  27. // MD5
  28. MD5 = 1;
  29. // SHA-1
  30. SHA1 = 2;
  31. // SHA-256
  32. SHA256 = 3;
  33. }
  34. // The identifier of the file or archive entry.
  35. // User-provided, must be unique for the repeated field it is in. When an
  36. // Append RPC is called with a Files field populated, if a File already exists
  37. // with this ID, that File will be overwritten with the new File proto.
  38. string uid = 1;
  39. // The URI of a file.
  40. // This could also be the URI of an entire archive.
  41. // Most log data doesn't need to be stored forever, so a ttl is suggested.
  42. // Note that if you ever move or delete the file at this URI, the link from
  43. // the server will be broken.
  44. string uri = 2;
  45. // The length of the file in bytes. Allows the filesize to be shown in the
  46. // UI. Omit if file is still being written or length is not known. This
  47. // could also be the length of an entire archive.
  48. google.protobuf.Int64Value length = 3;
  49. // The content-type (aka MIME-type) of the file. This is sent to the web
  50. // browser so it knows how to handle the file. (e.g. text/plain, image/jpeg,
  51. // text/html, etc). For zip archives, use "application/zip".
  52. string content_type = 4;
  53. // If the above path, length, and content_type are referring to an archive,
  54. // and you wish to refer to a particular entry within that archive, put the
  55. // particular archive entry data here.
  56. ArchiveEntry archive_entry = 5;
  57. // A url to a content display app/site for this file or archive entry.
  58. string content_viewer = 6;
  59. // Whether to hide this file or archive entry in the UI. Defaults to false.
  60. // A checkbox lets users see hidden files, but they're hidden by default.
  61. bool hidden = 7;
  62. // A short description of what this file or archive entry contains. This
  63. // description should help someone viewing the list of these files to
  64. // understand the purpose of this file and what they would want to view it
  65. // for.
  66. string description = 8;
  67. // The digest of this file in hexadecimal-like string if known.
  68. string digest = 9;
  69. // The algorithm corresponding to the digest if known.
  70. HashType hash_type = 10;
  71. }
  72. // Information specific to an entry in an archive.
  73. message ArchiveEntry {
  74. // The relative path of the entry within the archive.
  75. string path = 1;
  76. // The uncompressed length of the archive entry in bytes. Allows the entry
  77. // size to be shown in the UI. Omit if the length is not known.
  78. google.protobuf.Int64Value length = 2;
  79. // The content-type (aka MIME-type) of the archive entry. (e.g. text/plain,
  80. // image/jpeg, text/html, etc). This is sent to the web browser so it knows
  81. // how to handle the entry.
  82. string content_type = 3;
  83. }