mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 17:22:26 +00:00
interceptors: migrate to otel and add logging interceptor
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
32
example/pb/example.proto
Normal file
32
example/pb/example.proto
Normal file
@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package helloworld;
|
||||
|
||||
option go_package = "go.linka.cloud/grpc-toolkit/example;pb";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "validate/validate.proto";
|
||||
import "defaults/defaults.proto";
|
||||
|
||||
service Greeter {
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/greeter/hello"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc SayHelloStream (HelloStreamRequest) returns (stream HelloReply) {}
|
||||
}
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
|
||||
}
|
||||
|
||||
message HelloReply {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message HelloStreamRequest {
|
||||
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
|
||||
int64 count = 2 [(validate.rules).int64 = {gte: 1, lte: 10}, (defaults.value).int64 = 10];
|
||||
}
|
Reference in New Issue
Block a user