mirror of
https://gitee.com/johng/gf
synced 2026-06-22 00:03:35 +08:00
38 lines
941 B
Protocol Buffer
38 lines
941 B
Protocol Buffer
// protoc --gofast_out=plugins=grpc:. protocol/user/*.proto -I/Users/john/Workspace/Go/GOPATH/src -I/Users/john/Workspace/Go/GOPATH/src/gitee.com/johng/katyusha/.examples/tracing
|
|
syntax = "proto3";
|
|
|
|
package user;
|
|
|
|
option go_package = "protobuf/user";
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
// User service for tracing demo.
|
|
service User {
|
|
rpc Insert(InsertReq) returns (InsertRes) {}
|
|
rpc Query(QueryReq) returns (QueryRes) {}
|
|
rpc Delete(DeleteReq) returns (DeleteRes) {}
|
|
}
|
|
|
|
message InsertReq {
|
|
string Name = 1 [(gogoproto.moretags) = 'v:"required#Please input user name."'];
|
|
}
|
|
|
|
message InsertRes {
|
|
int32 Id = 1;
|
|
}
|
|
|
|
message QueryReq {
|
|
int32 Id = 1 [(gogoproto.moretags) = 'v:"min:1#User id is required for querying."'];
|
|
}
|
|
|
|
message QueryRes {
|
|
int32 Id = 1;
|
|
string Name = 2;
|
|
}
|
|
|
|
message DeleteReq {
|
|
int32 Id = 1 [(gogoproto.moretags) = 'v:"min:1#User id is required for deleting."'];
|
|
}
|
|
|
|
message DeleteRes {} |