1syntax = "proto3"; 2 3package test; 4 5option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/internal/linter/testdata"; 6 7import "lint.proto"; 8import "shared.proto"; 9 10message ValidRequest { 11 gitaly.Repository destination = 1 [(gitaly.target_repository)=true]; 12} 13 14message ValidRequestWithoutRepo { 15} 16 17message ValidStorageRequest { 18 string storage_name = 1 [(gitaly.storage)=true]; 19} 20 21message ValidResponse{} 22 23message ValidNestedRequest{ 24 ValidRequest inner_message = 1; 25} 26 27message ValidStorageNestedRequest{ 28 ValidStorageRequest inner_message = 1; 29} 30 31message ValidNestedSharedRequest { 32 gitaly.ObjectPool nested_target_repo = 1 [(gitaly.target_repository)=true]; 33} 34 35message ValidInnerNestedRequest { 36 message Header { 37 gitaly.Repository destination = 1 [(gitaly.target_repository)=true]; 38 } 39 40 Header header = 1; 41} 42 43message ValidStorageInnerNestedRequest { 44 message Header { 45 string storage_name = 1 [(gitaly.storage) = true]; 46 } 47 48 Header header = 1; 49} 50 51service InterceptedService { 52 // intercepted services do not need method operation and scope 53 // annotations. 54 option (gitaly.intercepted) = true; 55 56 rpc TestMethod(ValidRequest) returns (ValidResponse); 57} 58 59service ValidService { 60 rpc TestMethod(ValidRequest) returns (ValidResponse) { 61 option (gitaly.op_type) = { 62 op: ACCESSOR 63 }; 64 } 65 66 rpc TestMethod2(ValidRequest) returns (ValidResponse) { 67 option (gitaly.op_type) = { 68 op: MUTATOR 69 }; 70 } 71 72 rpc TestMethod3(ValidRequest) returns (ValidResponse) { 73 option (gitaly.op_type) = { 74 op: MUTATOR 75 scope_level: REPOSITORY // repo can be explicitly included 76 }; 77 } 78 79 rpc TestMethod5(ValidNestedRequest) returns (ValidResponse) { 80 option (gitaly.op_type) = { 81 op: MUTATOR 82 }; 83 } 84 85 rpc TestMethod6(ValidNestedSharedRequest) returns (ValidResponse) { 86 option (gitaly.op_type) = { 87 op: MUTATOR 88 }; 89 } 90 91 rpc TestMethod7(ValidInnerNestedRequest) returns (ValidResponse) { 92 option (gitaly.op_type) = { 93 op: MUTATOR 94 }; 95 } 96 97 rpc TestMethod8(ValidStorageRequest) returns (ValidResponse) { 98 option (gitaly.op_type) = { 99 op: MUTATOR 100 scope_level: STORAGE 101 }; 102 } 103 104 rpc TestMethod9(ValidStorageNestedRequest) returns (ValidResponse) { 105 option (gitaly.op_type) = { 106 op: MUTATOR 107 scope_level: STORAGE 108 }; 109 } 110 111 // Intercepted methods do not need operation type annotations. 112 rpc TestMethod10(ValidStorageRequest) returns (ValidResponse) { 113 option (gitaly.intercepted_method) = true; 114 } 115} 116