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

valid.proto « testdata « protoc-gen-gitaly-lint « tools - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9763b06708467a164330956dcfe28ecf1c7b20f (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
syntax = "proto3";

package test;

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

option go_package = "gitlab.com/gitlab-org/gitaly/v14/tools/protoc-gen-gitaly-lint/testdata";

message ValidRequest {
  gitaly.Repository destination = 1 [(gitaly.target_repository)=true];
}

message ValidRequestWithoutRepo {
}

message ValidStorageRequest {
  string storage_name = 1 [(gitaly.storage)=true];
}

message ValidResponse{
}

message ValidNestedRequest{
  ValidRequest inner_message = 1;
}

message ValidStorageNestedRequest{
  ValidStorageRequest inner_message = 1;
}

message ValidNestedSharedRequest {
  gitaly.ObjectPool nested_target_repo = 1 [(gitaly.target_repository)=true];
}

message ValidInnerNestedRequest {
  message Header {
    gitaly.Repository destination = 1 [(gitaly.target_repository)=true];
  }

  Header header = 1;
}

message ValidStorageInnerNestedRequest {
  message Header {
    string storage_name = 1 [(gitaly.storage) = true];
  }

  Header header = 1;
}

service InterceptedService {
  // intercepted services do not need method operation and scope
  // annotations.
  option (gitaly.intercepted) = true;

  rpc TestMethod(ValidRequest) returns (ValidResponse);
}

service ValidService {
  rpc TestMethod(ValidRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: ACCESSOR
    };
  }

  rpc TestMethod2(ValidRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
    };
  }

  rpc TestMethod3(ValidRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
      scope_level: REPOSITORY // repo can be explicitly included
    };
  }

  rpc TestMethod5(ValidNestedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
    };
  }

  rpc TestMethod6(ValidNestedSharedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
    };
  }

  rpc TestMethod7(ValidInnerNestedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
    };
  }

  rpc TestMethod8(ValidStorageRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
      scope_level: STORAGE
    };
  }

  rpc TestMethod9(ValidStorageNestedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MUTATOR
      scope_level: STORAGE
    };
  }

  // Intercepted methods do not need operation type annotations.
  rpc TestMethod10(ValidStorageRequest) returns (ValidResponse) {
    option (gitaly.intercepted_method) = true;
  }

  rpc TestMaintenance(ValidRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MAINTENANCE
    };
  }

  rpc TestMaintenanceWithExplicitScope(ValidRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MAINTENANCE
      scope_level: REPOSITORY // repo can be explicitly included
    };
  }

  rpc TestMaintenanceWithNestedRequest(ValidNestedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MAINTENANCE
    };
  }

  rpc TestMaintenanceWithNestedSharedRequest(ValidNestedSharedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MAINTENANCE
    };
  }

  rpc TestMutatorWithInnerNestedRequest(ValidInnerNestedRequest) returns (ValidResponse) {
    option (gitaly.op_type) = {
      op: MAINTENANCE
    };
  }

}