Welcome to mirror list, hosted at ThFree Co, Russian Federation.

blob.proto « proto - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 73a78670bfc15846fc90d9a4cf4af7e326d4228d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
syntax = "proto3";

package gitaly;

import "lint.proto";
import "shared.proto";

option go_package = "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb";

// BlobService is a service which provides RPCs to retrieve Git blobs from a
// specific repository.
service BlobService {

  // GetBlob returns the contents of a blob object referenced by its object
  // ID. We use a stream to return a chunked arbitrarily large binary
  // response
  rpc GetBlob(GetBlobRequest) returns (stream GetBlobResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // GetBlobs returns blobs identified via a revision and path.
  //
  // Note that the behaviour of this RPC is quite weird: it does not only return blobs, but will also return submodules
  // as commits and trees. It's use is thus discouraged in favor of ListBlobs, which behaves more sanely.
  rpc GetBlobs(GetBlobsRequest) returns (stream GetBlobsResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // ListBlobs will list all blobs reachable from a given set of revisions by
  // doing a graph walk. It is not valid to pass revisions which do not resolve
  // to an existing object.
  rpc ListBlobs(ListBlobsRequest) returns (stream ListBlobsResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // ListAllBlobs retrieves all blobs pointers in the repository, including
  // those not reachable by any reference.
  rpc ListAllBlobs(ListAllBlobsRequest) returns (stream ListAllBlobsResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // GetLFSPointers retrieves LFS pointers from a given set of object IDs.
  // This RPC filters all requested objects and only returns those which refer
  // to a valid LFS pointer.
  rpc GetLFSPointers(GetLFSPointersRequest) returns (stream GetLFSPointersResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // ListLFSPointers retrieves LFS pointers reachable from a given set of
  // revisions by doing a graph walk. This includes both normal revisions like
  // an object ID or branch, but also the pseudo-revisions "--all" and "--not"
  // as documented in git-rev-parse(1). Revisions which don't directly or
  // transitively reference any LFS pointers are ignored. It is not valid to
  // pass revisions which do not resolve to an existing object.
  rpc ListLFSPointers(ListLFSPointersRequest) returns (stream ListLFSPointersResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

  // ListAllLFSPointers retrieves all LFS pointers in the repository, including
  // those not reachable by any reference.
  rpc ListAllLFSPointers(ListAllLFSPointersRequest) returns (stream ListAllLFSPointersResponse) {
    option (op_type) = {
      op: ACCESSOR
    };
  }

}

// GetBlobRequest is a request for the GetBlob RPC.
message GetBlobRequest {
  // repository is the repository that shall be searched.
  Repository repository = 1[(target_repository)=true];
  // oid is the object ID of the blob we want to get.
  string oid = 2;
  // limit is the maximum number of bytes we want to receive. Use '-1' to get the full blob no matter how big. Setting
  // this to `0` will return no data.
  int64 limit = 3;
}

// GetBlobResponse is a response for the GetBlob RPC. Multiple responses will be returned when the blob is large and
// thus doesn't fit into a single response.
message GetBlobResponse {
  // size is the size of the blob. Present only in first response message.
  int64 size = 1;
  // data is a chunk of data.
  bytes data = 2;
  // oid of the actual blob returned. Empty if no blob was found.
  string oid = 3;
}

// GetBlobsRequest is a request for the GetBlobs RPC.
message GetBlobsRequest {
  // RevisionPath is a combination of revision and path. All objects reachable in the subdirectory of the treeish
  // will be returned.
  message RevisionPath {
    // revision is the revision that identifies the tree-ish. Must not be empty.
    string revision = 1;
    // path is the path relative to the treeish revision that shall be searched for a blob. If the path is empty the
    // root directory of the tree-ish will be searched.
    bytes path = 2;
  }

  // repository is the repository that shall be searched.
  Repository repository = 1[(target_repository)=true];
  // revision_paths identifies the set of revision/path pairs that shall be searched for blobs.
  repeated RevisionPath revision_paths = 2;
  // limit is the maximum number of bytes we want to receive. Use '-1' to get the full blobs no matter how big.
  int64 limit = 3;
}

// GetBlobsResponse is a response for the GetBlobs RPC and identifies a single blob. Multiple responses can be returned
// for the same blob in case its data is longer than the gRPC message limit. Subsequent messages for the same blob will
// only have their data field set. Blobs which cannot be found will only have their path and revision set, but will
// otherwise be empty.
message GetBlobsResponse {
  // size is the size of the blob. Present only on the first message per blob
  int64 size = 1;
  // data is a chunk of blob data, which could span over multiple messages.
  bytes data = 2;
  // oid is the object ID of the current blob. Only present on the first message per blob. Empty if no blob was
  // found.
  string oid = 3;
  // is_submodule indicates whether the blob is a submodule.
  bool is_submodule = 4;
  // mode is the file mode of blob as present in the tree. It is typically one of:
  //
  // - 0o100644 for non-executable files.
  // - 0o100755 for executable files.
  // - 0o160000 for submodules.
  // - 0o040000 for subtrees.
  int32 mode = 5;
  // revision is the revision that this blob has been traversed from.
  string revision = 6;
  // path is the path of the blob inside of the tree.
  bytes path = 7;
  // type is the type of the "blob".
  ObjectType type = 8;
}

// ListBlobsRequest is a request for the ListBlobs RPC.
message ListBlobsRequest {
  // repository is the repository in which blobs should be enumerated.
  Repository repository = 1 [(target_repository)=true];
  // revisions is the list of revisions to retrieve blobs from. These revisions
  // will be walked. Supports pseudo-revisions `--all` and `--not` as well as
  // negated revisions via `^revision`. Revisions cannot start with a leading
  // dash. Please consult gitrevisions(7) for more info. Must not be empty.
  repeated string revisions = 2;
  // limit is the maximum number of blobs to return. If set to its default
  // (`0`), then all found blobs wll be returned.
  uint32 limit = 3;
  // bytes_limit is the maximum number of bytes to receive for each blob. If set
  // to `0`, then no blob data will be sent. If `-1`, then all blob data will
  // be sent without any limits.
  int64 bytes_limit = 4;
  // with_paths determines whether paths of blobs should be returned. When
  // set to `true`, paths are returned on a best-effort basis: a path will only
  // exist if the blob was traversed via a tree.
  bool with_paths = 5;
}

// ListBlobsResponse is a response for the ListBlobs RPC.
message ListBlobsResponse {
  // Blob represents a Git blob object.
  message Blob {
    // oid is the object ID of the blob. Will only be set for the first
    // message of each specific blob.
    string oid = 1;
    // size is the size of the blob. Will only be set for the first message
    // of each specific blob.
    int64 size = 2;
    // data is the contents of the blob. This field is optional and depends on
    // the BytesLimit in the original request.
    bytes data = 3;
    // path is the path of the blob. May be unset depending on how the blob had
    // been traversed.
    bytes path = 4;
  }

  // blobs is the blobs which have been found. In case blob contents were
  // requested and contents of a blob exceed the maximum gRPC message size,
  // then this blob will be split up into multiple blob messages which span
  // across multiple responses. In that case, metadata of the blob will only be
  // sent on the first such message for this specific blob.
  repeated Blob blobs = 1;
}

// ListAllBlobsRequest is a request for the ListAllBlobs RPC.
message ListAllBlobsRequest {
  // repository is the repository in which blobs should be enumerated.
  Repository repository = 1 [(target_repository)=true];
  // limit is the maximum number of blobs to return. If set to its default
  // (`0`), then all found blobs wll be returned.
  uint32 limit = 2;
  // bytes_limit is the maximum number of bytes to receive for each blob. If set
  // to `0`, then no blob data will be sent. If `-1`, then all blob data will
  // be sent without any limits.
  int64 bytes_limit = 3;
}

// ListAllBlobsResponse is a response for the ListAllBlobs RPC.
message ListAllBlobsResponse {
  // Blob represents a Git blob object.
  message Blob {
    // oid is the object ID of the blob. Will only be set for the first
    // message of each specific blob.
    string oid = 1;
    // size is the size of the blob. Will only be set for the first message
    // of each specific blob.
    int64 size = 2;
    // data is the contents of the blob. This field is optional and depends on
    // the BytesLimit in the original request.
    bytes data = 3;
  }

  // blobs is the blobs which have been found. In case blob contents were
  // requested and contents of a blob exceed the maximum gRPC message size,
  // then this blob will be split up into multiple blob messages which span
  // across multiple responses. In that case, metadata of the blob will only be
  // sent on the first such message for this specific blob.
  repeated Blob blobs = 1;
}

// LFSPointer is a git blob which points to an LFS object.
message LFSPointer {
  // size is the size of the blob. This is not the size of the LFS object
  // pointed to.
  int64 size = 1;
  // data is the bare data of the LFS pointer blob. It contains the pointer to
  // the LFS data in the format specified by the LFS project.
  bytes data = 2;
  // oid is the object ID of the blob.
  string oid = 3;
}

// GetLFSPointersRequest is a request for the GetLFSPointers RPC.
message GetLFSPointersRequest {
  // repository is the repository for which LFS pointers should be retrieved
  // from.
  Repository repository = 1[(target_repository)=true];
  // blob_ids is the list of blobs to retrieve LFS pointers from. Must be a
  // non-empty list of blobs IDs to fetch.
  repeated string blob_ids = 2;
}

// GetLFSPointersResponse is a response for the GetLFSPointers RPC.
message GetLFSPointersResponse {
  // lfs_pointers is the list of LFS pointers which were requested.
  repeated LFSPointer lfs_pointers = 1;
}

// ListLFSPointersRequest is a request for the ListLFSPointers RPC.
message ListLFSPointersRequest {
  // repository is the repository for which LFS pointers should be retrieved
  // from.
  Repository repository = 1[(target_repository)=true];
  // revisions is the list of revisions to retrieve LFS pointers from. Must be
  // a non-empty list.
  repeated string revisions = 2;
  // limit limits the number of LFS pointers returned.
  int32 limit = 3;
}

// ListLFSPointersResponse is a response for the ListLFSPointers RPC.
message ListLFSPointersResponse {
  // lfs_pointers is the list of LFS pointers which were requested.
  repeated LFSPointer lfs_pointers = 1;
}

// ListAllLFSPointersRequest is a request for the ListAllLFSPointers RPC.
message ListAllLFSPointersRequest {
  // repository is the repository for which LFS pointers should be retrieved
  // from.
  Repository repository = 1[(target_repository)=true];
  // limit limits the number of LFS pointers returned.
  int32 limit = 3;
}

// ListAllLFSPointersResponse is a response for the ListAllLFSPointers RPC.
message ListAllLFSPointersResponse {
  // lfs_pointers is the list of LFS pointers which were requested.
  repeated LFSPointer lfs_pointers = 1;
}