1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-05-19 21:23:04 +02:00

69 lines
1.3 KiB
Go
Raw Normal View History

2021-08-30 16:48:57 +02:00
package template
// ProtoFNC is the .proto file template used for new function projects.
var ProtoFNC = `syntax = "proto3";
package {{dehyphen .Service}};
2021-08-30 16:48:57 +02:00
option go_package = "./proto;{{dehyphen .Service}}";
2021-08-30 16:48:57 +02:00
service {{title .Service}} {
2021-08-30 16:48:57 +02:00
rpc Call(CallRequest) returns (CallResponse) {}
}
message CallRequest {
string name = 1;
}
message CallResponse {
string msg = 1;
}
`
// ProtoSRV is the .proto file template used for new service projects.
var ProtoSRV = `syntax = "proto3";
package {{dehyphen .Service}};
2021-08-30 16:48:57 +02:00
option go_package = "./proto;{{dehyphen .Service}}";
2021-08-30 16:48:57 +02:00
service {{title .Service}} {
2021-08-30 16:48:57 +02:00
rpc Call(CallRequest) returns (CallResponse) {}
rpc ClientStream(stream ClientStreamRequest) returns (ClientStreamResponse) {}
rpc ServerStream(ServerStreamRequest) returns (stream ServerStreamResponse) {}
rpc BidiStream(stream BidiStreamRequest) returns (stream BidiStreamResponse) {}
}
message CallRequest {
string name = 1;
}
message CallResponse {
string msg = 1;
}
message ClientStreamRequest {
int64 stroke = 1;
}
message ClientStreamResponse {
int64 count = 1;
}
message ServerStreamRequest {
int64 count = 1;
}
message ServerStreamResponse {
int64 count = 1;
}
message BidiStreamRequest {
int64 stroke = 1;
}
message BidiStreamResponse {
int64 stroke = 1;
}
`