add tags example

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-05-08 12:46:02 +03:00
parent d41fa1a64f
commit 805b52cf8d
2 changed files with 45 additions and 1 deletions

View File

@ -16,7 +16,7 @@ $> protoc --micro_out=debug=true,components="micro|http":. input.proto
| Option | Default Value | Accepted Values | Description
|-----------------------|---------------|---------------------------|-----------------------
| `debug`               | *false*       | `true` or `false` | if *true*, `protoc` will generate a more verbose output
| `components` | `micro` | `micro rpc http chi gorilla` | some values cant coexists like gorilla/chi or rpc/http, values must be concatinated with pipe symbol
| `components` | `micro` | `micro rpc http chi gorilla client server` | some values can't coexists like gorilla/chi or rpc/http, values must be concatinated with pipe symbol
## Install

44
example/example.proto Normal file
View File

@ -0,0 +1,44 @@
syntax = "proto3";
package example;
option go_package = "github.com/unistack-org/protoc-gen-micro/v3/example;examplepb";
import "tag/tag.proto";
import "api/annotations.proto";
import "openapiv2/annotations.proto";
import "google/protobuf/wrappers.proto";
service Example {
rpc Call(CallReq) returns (CallRsp) {
option (micro.openapiv2.openapiv2_operation) = {
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: "*"; };
option (micro.api.micro_method) = { timeout: 5; };
};
};
message CallReq {
string name = 1 [(micro.tag.tags) = "xml:\",attr\"" ];
string req = 2;
};
message CallRsp {
string rsp = 2;
};
message Error {
string msg = 1;
};