File: flow_combination.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway.v2 2.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,148 kB
  • sloc: javascript: 352; makefile: 136; sh: 26
file content (170 lines) | stat: -rw-r--r-- 4,404 bytes parent folder | download
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
syntax = "proto3";

package grpc.gateway.examples.internal.proto.examplepb;

import "google/api/annotations.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";

message EmptyProto {}

message NonEmptyProto {
  string a = 1;
  string b = 2;
  string c = 3;
}

message UnaryProto {
  string str = 1;
}

message NestedProto {
  UnaryProto a = 1;
  string b = 2;
  string c = 3;
}

message SingleNestedProto {
  UnaryProto a = 1;
}

service FlowCombination {
  rpc RpcEmptyRpc(EmptyProto) returns (EmptyProto) {
    option (google.api.http) = {
      post: "/rpc/empty/rpc"
    };
  }
  rpc RpcEmptyStream(EmptyProto) returns (stream EmptyProto) {
    option (google.api.http) = {
      post: "/rpc/empty/stream"
    };
  }
  rpc StreamEmptyRpc(stream EmptyProto) returns (EmptyProto) {
    option (google.api.http) = {
      post: "/stream/empty/rpc"
    };
  }
  rpc StreamEmptyStream(stream EmptyProto) returns (stream EmptyProto) {
    option (google.api.http) = {
      post: "/stream/empty/stream"
    };
  }

  rpc RpcBodyRpc(NonEmptyProto) returns (EmptyProto) {
    option (google.api.http) = {
      // w/ body; w/o path; w/o query
      post: "/rpc/body/rpc"
      body: "*"

      // w/o body; w/ path; w/o query
      additional_bindings {
        post: "/rpc/path/{a}/{b}/{c}/rpc"
      }
      // w/o body; w/o path; w/ query
      additional_bindings {
        post: "/rpc/query/rpc"
      }
      // w/ body; w/ path; w/o query
      additional_bindings {
        post: "/rpc/body/path/{a}/{b}/rpc"
        body: "c"
      }
      // w/ body; w/o path; w/ query
      additional_bindings {
        post: "/rpc/body/query/rpc"
        body: "c"
      }
      // w/ body; w/ path; w/ query
      additional_bindings {
        post: "/rpc/body/path/{a}/query/rpc"
        body: "c"
      }
      // w/o body; w/ path; w/ query
      additional_bindings {
        post: "/rpc/path/{a}/query/rpc"
      }
    };
  }
  rpc RpcPathSingleNestedRpc(SingleNestedProto) returns (EmptyProto) {
    option (google.api.http) = {
      // w/o body; w/ path (IsNestedProto3); w/o query
      post: "/rpc/path-nested/{a.str}/rpc"
    };
  }
  rpc RpcPathNestedRpc(NestedProto) returns (EmptyProto) {
    option (google.api.http) = {
      // w/ body; w/ path (IsNestedProto3); w/o query
      post: "/rpc/path-nested/{a.str}/{b}/rpc"
      body: "c"

      // w/o body; w/ path (IsNestedProto3); w/ query
      additional_bindings {
        post: "/rpc/path-nested1/{a.str}/rpc"
      }
      // w/ body; w/ path (IsNestedProto3); w/ query
      additional_bindings {
        post: "/rpc/path-nested2/{a.str}/rpc"
        body: "c"
      }
    };
  }

  rpc RpcBodyStream(NonEmptyProto) returns (stream EmptyProto) {
    option (google.api.http) = {
      // w/ body; w/o path; w/o query
      post: "/rpc/body/stream"
      body: "*"

      // w/o body; w/ path; w/o query
      additional_bindings {
        post: "/rpc/path/{a}/{b}/{c}/stream"
      }
      // w/o body; w/o path; w/ query
      additional_bindings {
        post: "/rpc/query/stream"
      }
      // w/ body; w/ path; w/o query
      additional_bindings {
        post: "/rpc/body/path/{a}/{b}/stream"
        body: "c"
      }
      // w/ body; w/o path; w/ query
      additional_bindings {
        post: "/rpc/body/query/stream"
        body: "c"
      }
      // w/ body; w/ path; w/ query
      additional_bindings {
        post: "/rpc/body/path/{a}/query/stream"
        body: "c"
      }
      // w/o body; w/ path; w/ query
      additional_bindings {
        post: "/rpc/path/{a}/query/stream"
      }
    };
  }
  rpc RpcPathSingleNestedStream(SingleNestedProto) returns (stream EmptyProto) {
    option (google.api.http) = {
      // w/o body; w/ path (IsNestedProto3); w/o query
      post: "/rpc/path-nested/{a.str}/stream"
    };
  }
  rpc RpcPathNestedStream(NestedProto) returns (stream EmptyProto) {
    option (google.api.http) = {
      // w/ body; w/ path (IsNestedProto3); w/o query
      post: "/rpc/path-nested/{a.str}/{b}/stream"
      body: "c"

      // w/o body; w/ path (IsNestedProto3); w/ query
      additional_bindings {
        post: "/rpc/path-nested1/{a.str}/stream"
      }
      // w/ body; w/ path (IsNestedProto3); w/ query
      additional_bindings {
        post: "/rpc/path-nested2/{a.str}/stream"
        body: "c"
      }
    };
  }
}