-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathservice_data.proto
More file actions
121 lines (111 loc) · 4.78 KB
/
service_data.proto
File metadata and controls
121 lines (111 loc) · 4.78 KB
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
/*
* Copyright 2018 source{d}. 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 pb;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "gopkg.in/bblfsh/sdk.v1/uast/generated.proto";
import "lookout/sdk/event.proto";
option (gogoproto.goproto_getters_all) = false;
// Data services exposes VCS repositories.
service Data {
// GetChanges returns a stream of Changes
rpc GetChanges (ChangesRequest) returns (stream Change);
// GetFiles returns a stream of Files
rpc GetFiles (FilesRequest) returns (stream File);
}
// File is a repository file.
message File {
option (gogoproto.sizer) = false;
option (gogoproto.protosizer) = true;
// File path.
string path = 1;
// POSIX-style file mode.
uint32 mode = 2;
// SHA1 hash of the file contents.
string hash = 3;
// Raw content of the file. It will be empty if WantContents was not set in
// the request.
bytes content = 4;
// UAST is a Babelfish v1 UAST of the file contents. It will be empty if
// WantUAST was not set in the request.
gopkg.in.bblfsh.sdk.v1.uast.Node uast = 5 [(gogoproto.customname) = "UAST"];
// Programming/data/markup language of the file as returned by enry. It will
// be empty unless WantLanguage or WantUAST were set in the request.
string language = 6;
}
// Change contains two versions of a File in a revision range.
message Change {
option (gogoproto.sizer) = false;
option (gogoproto.protosizer) = true;
// Base is the file version at the base of the revision range. It will be
// empty for new files.
File base = 1;
// Head is the file version at the head of the revision range. It will be
// empty for deleted files.
File head = 2;
}
// ChangesRequest defines a request of Changes to the Data service.
message ChangesRequest {
// Base of the revision range.
ReferencePointer base = 1;
// Head of the revision range.
ReferencePointer head = 2;
// IncludePattern is a regexp. Only the files with matching file paths will
// be included in the response.
string include_pattern = 3;
// ExcludePattern is a regexp. Any files with matching file paths will be
// excluded from the response.
string exclude_pattern = 4;
// ExcludeVendored will exclude any verdored file from the response. The
// list of paths considered as vendor is available at:
// https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml
bool exclude_vendored = 5;
// WantContents will fill the response file Content.
bool want_contents = 6;
// WantUAST will fill the response file UAST and Language.
bool want_uast = 7 [(gogoproto.customname) = "WantUAST"];
// WantLanguage will fill the response file Language.
bool want_language = 8;
// IncludeLanguages will filter files by language. The language names are
// case insensitive. The list of language names is available at
// https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
repeated string include_languages = 9;
}
// FilesRequest defines a request of Files to the Data service.
message FilesRequest {
// Revision of the file.
ReferencePointer revision = 1;
// IncludePattern is a regexp. Only the files with matching file paths will
// be included in the response.
string include_pattern = 2;
// ExcludePattern is a regexp. Any files with matching file paths will be
// excluded from the response.
string exclude_pattern = 3;
// ExcludeVendored will exclude any verdored file from the response. The
// list of paths considered as vendor is available at:
// https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml
bool exclude_vendored = 4;
// WantContents will fill the response file Content.
bool want_contents = 5;
// WantUAST will fill the response file UAST and Language.
bool want_uast = 6 [(gogoproto.customname) = "WantUAST"];
// WantLanguage will fill the response file Language.
bool want_language = 7;
// IncludeLanguages will filter files by language. The language names are
// case insensitive. The list of language names is available at
// https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
repeated string include_languages = 8;
}