2021-02-06 19:08:01 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package test;
|
2021-02-27 19:51:56 +03:00
|
|
|
|
2021-10-27 01:24:35 +03:00
|
|
|
option go_package = "go.unistack.org/micro-tests/server/http/proto;pb";
|
2021-02-27 19:51:56 +03:00
|
|
|
|
2021-05-08 12:45:08 +03:00
|
|
|
import "tag/tag.proto";
|
2021-02-27 19:51:56 +03:00
|
|
|
import "api/annotations.proto";
|
2021-10-27 01:24:35 +03:00
|
|
|
import "openapiv3/annotations.proto";
|
2021-02-06 19:08:01 +03:00
|
|
|
import "google/protobuf/wrappers.proto";
|
|
|
|
|
2021-03-09 14:25:27 +03:00
|
|
|
service TestDouble {
|
|
|
|
//option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
|
|
|
|
rpc CallDouble(CallReq) returns (CallRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-03-09 14:25:27 +03:00
|
|
|
operation_id: "Call";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-03-09 14:25:27 +03:00
|
|
|
};
|
2021-07-31 15:17:18 +03:00
|
|
|
option (micro.api.http) = { post: "/v1/testdouble/call/name/{name}"; body: "*"; };
|
2021-05-08 12:45:08 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: 5; };
|
2021-03-09 14:25:27 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-06 19:08:01 +03:00
|
|
|
service Test {
|
2021-04-19 11:36:58 +03:00
|
|
|
rpc CallRepeatedString(CallReq) returns (CallRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-04-19 11:36:58 +03:00
|
|
|
operation_id: "CallRepeatedString";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-04-19 02:16:00 +03:00
|
|
|
};
|
2021-09-30 03:10:20 +03:00
|
|
|
option (micro.api.http) = { post: "/v1/test/call_repeated_string"; body: "*"; };
|
2021-05-08 12:45:08 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: 5; };
|
2021-04-19 02:16:00 +03:00
|
|
|
};
|
2021-04-19 11:36:58 +03:00
|
|
|
rpc CallRepeatedInt64(CallReq) returns (CallRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-04-19 11:36:58 +03:00
|
|
|
operation_id: "CallRepeatedInt64";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-04-19 11:36:58 +03:00
|
|
|
};
|
2021-09-30 03:10:20 +03:00
|
|
|
option (micro.api.http) = { post: "/v1/test/call_repeated_int64"; body: "*"; };
|
2021-05-08 12:45:08 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: 5; };
|
2021-04-19 11:36:58 +03:00
|
|
|
};
|
|
|
|
|
2021-04-19 02:16:00 +03:00
|
|
|
|
2021-03-09 14:25:27 +03:00
|
|
|
//option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
|
2021-02-06 19:08:01 +03:00
|
|
|
rpc Call(CallReq) returns (CallRsp) {
|
2021-10-27 13:17:06 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
|
|
|
operation_id: "Call";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-10-27 13:17:06 +03:00
|
|
|
parameters: {
|
|
|
|
parameter: {
|
|
|
|
name: "Clientid";
|
|
|
|
in: "header";
|
|
|
|
schema: {
|
|
|
|
schema: {
|
|
|
|
type: "string";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
required: true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
parameters: {
|
|
|
|
parameter: {
|
|
|
|
name: "Csrftoken";
|
|
|
|
in: "cookie";
|
|
|
|
schema: {
|
|
|
|
schema: {
|
|
|
|
type: "string";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
required: true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-02-27 19:51:56 +03:00
|
|
|
option (micro.api.http) = { post: "/v1/test/call/{name}"; body: "*"; };
|
2021-05-08 12:45:08 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: 5; };
|
2021-02-06 19:08:01 +03:00
|
|
|
};
|
|
|
|
rpc CallError(CallReq1) returns (CallRsp1) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-02-06 19:08:01 +03:00
|
|
|
operation_id: "CallError";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-02-06 19:08:01 +03:00
|
|
|
};
|
2021-02-27 19:51:56 +03:00
|
|
|
option (micro.api.http) = { post: "/v1/test/callerror/{name}"; body: "*"; };
|
2021-02-06 19:08:01 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
message CallReq {
|
2021-05-08 12:45:08 +03:00
|
|
|
string name = 1 [(micro.tag.tags) = "xml:\",attr\"" ];
|
2021-02-06 19:08:01 +03:00
|
|
|
string req = 2;
|
|
|
|
string arg1 = 3;
|
|
|
|
uint64 arg2 = 4;
|
|
|
|
Nested nested = 5;
|
2021-04-19 11:36:58 +03:00
|
|
|
repeated string string_ids = 6;
|
|
|
|
repeated int64 int64_ids = 7;
|
2021-10-27 13:17:06 +03:00
|
|
|
string Clientid = 8;
|
|
|
|
string Csrftoken = 9;
|
2021-02-06 19:08:01 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
message Nested {
|
|
|
|
repeated string string_args = 1;
|
|
|
|
repeated google.protobuf.UInt64Value uint64_args = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CallRsp {
|
|
|
|
string rsp = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
message CallReq1 {
|
|
|
|
string name = 1;
|
|
|
|
string req = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
message CallRsp1 {
|
|
|
|
string rsp = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
message Error {
|
|
|
|
string msg = 1;
|
|
|
|
};
|