2021-05-08 12:46:02 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package example;
|
|
|
|
|
2021-06-22 01:34:06 +03:00
|
|
|
option go_package = "github.com/unistack-org/protoc-gen-go-micro/v3/example;examplepb";
|
2021-05-08 12:46:02 +03:00
|
|
|
|
|
|
|
import "tag/tag.proto";
|
|
|
|
import "api/annotations.proto";
|
|
|
|
import "openapiv2/annotations.proto";
|
|
|
|
import "google/protobuf/wrappers.proto";
|
2024-06-11 20:45:09 +03:00
|
|
|
import "graphql.proto";
|
2021-05-08 12:46:02 +03:00
|
|
|
|
|
|
|
service Example {
|
2024-06-11 20:45:09 +03:00
|
|
|
option (graphql.service) = {
|
|
|
|
host: "localhost:9090";
|
|
|
|
};
|
2021-05-08 12:46:02 +03:00
|
|
|
rpc Call(CallReq) returns (CallRsp) {
|
2024-06-11 20:45:09 +03:00
|
|
|
option (graphql.schema) = {
|
|
|
|
type: QUERY
|
|
|
|
name: "Call"
|
|
|
|
};
|
2021-10-23 23:30:16 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-05-08 12:46:02 +03:00
|
|
|
operation_id: "Call";
|
|
|
|
responses: {
|
|
|
|
key: "default";
|
|
|
|
value: {
|
|
|
|
description: "Error response";
|
|
|
|
schema: {
|
|
|
|
json_schema: {
|
|
|
|
ref: ".example.Error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
option (micro.api.http) = { post: "/v1/example/call/{name}"; body: "*"; };
|
2022-11-15 12:53:04 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: "5s"; };
|
2021-05-08 12:46:02 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
message CallReq {
|
|
|
|
string name = 1 [(micro.tag.tags) = "xml:\",attr\"" ];
|
|
|
|
string req = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
message CallRsp {
|
|
|
|
string rsp = 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
message Error {
|
|
|
|
string msg = 1;
|
|
|
|
};
|