1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.devtools.resultstore.v2; 18 19import "google/protobuf/wrappers.proto"; 20 21option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore"; 22option java_multiple_files = true; 23option java_outer_classname = "FileProto"; 24option java_package = "com.google.devtools.resultstore.v2"; 25 26// The metadata for a file or an archive file entry. 27message File { 28 // If known, the hash function used to compute this digest. 29 enum HashType { 30 // Unknown 31 HASH_TYPE_UNSPECIFIED = 0; 32 33 // MD5 34 MD5 = 1; 35 36 // SHA-1 37 SHA1 = 2; 38 39 // SHA-256 40 SHA256 = 3; 41 } 42 43 // The identifier of the file or archive entry. 44 // User-provided, must be unique for the repeated field it is in. When an 45 // Append RPC is called with a Files field populated, if a File already exists 46 // with this ID, that File will be overwritten with the new File proto. 47 string uid = 1; 48 49 // The URI of a file. 50 // This could also be the URI of an entire archive. 51 // Most log data doesn't need to be stored forever, so a ttl is suggested. 52 // Note that if you ever move or delete the file at this URI, the link from 53 // the server will be broken. 54 string uri = 2; 55 56 // The length of the file in bytes. Allows the filesize to be shown in the 57 // UI. Omit if file is still being written or length is not known. This 58 // could also be the length of an entire archive. 59 google.protobuf.Int64Value length = 3; 60 61 // The content-type (aka MIME-type) of the file. This is sent to the web 62 // browser so it knows how to handle the file. (e.g. text/plain, image/jpeg, 63 // text/html, etc). For zip archives, use "application/zip". 64 string content_type = 4; 65 66 // If the above path, length, and content_type are referring to an archive, 67 // and you wish to refer to a particular entry within that archive, put the 68 // particular archive entry data here. 69 ArchiveEntry archive_entry = 5; 70 71 // A url to a content display app/site for this file or archive entry. 72 string content_viewer = 6; 73 74 // Whether to hide this file or archive entry in the UI. Defaults to false. 75 // A checkbox lets users see hidden files, but they're hidden by default. 76 bool hidden = 7; 77 78 // A short description of what this file or archive entry contains. This 79 // description should help someone viewing the list of these files to 80 // understand the purpose of this file and what they would want to view it 81 // for. 82 string description = 8; 83 84 // The digest of this file in hexadecimal-like string if known. 85 string digest = 9; 86 87 // The algorithm corresponding to the digest if known. 88 HashType hash_type = 10; 89} 90 91// Information specific to an entry in an archive. 92message ArchiveEntry { 93 // The relative path of the entry within the archive. 94 string path = 1; 95 96 // The uncompressed length of the archive entry in bytes. Allows the entry 97 // size to be shown in the UI. Omit if the length is not known. 98 google.protobuf.Int64Value length = 2; 99 100 // The content-type (aka MIME-type) of the archive entry. (e.g. text/plain, 101 // image/jpeg, text/html, etc). This is sent to the web browser so it knows 102 // how to handle the entry. 103 string content_type = 3; 104} 105