1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-23 17:53:05 +02:00
Niek den Breeje 5772697752
Make generator package a first class citizen (#2259)
There's really no point in having the `generator` be embedded in a
`file` package so we remove the `file` package and make the `generator`
package a first class citizen instead.
2021-09-10 13:31:52 +01:00

69 lines
1.3 KiB
Go

package template
// ProtoFNC is the .proto file template used for new function projects.
var ProtoFNC = `syntax = "proto3";
package {{dehyphen .Service}};
option go_package = "./proto;{{dehyphen .Service}}";
service {{title .Service}} {
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}};
option go_package = "./proto;{{dehyphen .Service}}";
service {{title .Service}} {
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;
}
`