add metrics, tracing, validation interceptors, add options: WithInterceptors, With{Client,Server}Interceptors

This commit is contained in:
2021-11-21 14:58:49 +01:00
parent 9ae20eab1e
commit dc78a2c688
15 changed files with 401 additions and 41 deletions

View File

@ -5,6 +5,7 @@ package helloworld;
option go_package = "go.linka.cloud/grpc/example;main";
import "google/api/annotations.proto";
import "validate/validate.proto";
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {
@ -17,7 +18,7 @@ service Greeter {
}
message HelloRequest {
string name = 1;
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
}
message HelloReply {
@ -25,6 +26,6 @@ message HelloReply {
}
message HelloStreamRequest {
string name = 1;
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
int64 count = 2;
}