-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from storyicon/v0.4.0
feat(*): support perComandTimeout & variables in options
- Loading branch information
Showing
15 changed files
with
298 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Using Multi Config Items | ||
|
||
This example uses two different configurations for "using-gogo" and "using-googleapis" through the "scope" field. | ||
|
||
It uses the following public libraries: | ||
* [googleapis](https://github.com/googleapis/googleapis) | ||
|
||
The following plug-ins are used: | ||
* [protoc-gen-go](https://google.golang.org/protobuf/cmd/protoc-gen-go) | ||
* [protoc-gen-go-grpc](https://google.golang.org/grpc/cmd/protoc-gen-go-grpc) | ||
* [protoc-gen-grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway) | ||
* [protoc-gen-gogo](https://github.com/gogo/protobuf/protoc-gen-gogo) | ||
|
||
|
||
You can compile the proto file in this directory by executing the following command: | ||
``` | ||
powerproto build -r . | ||
``` | ||
|
||
Not surprisingly, you will get the following output: | ||
``` | ||
➜ tree | ||
. | ||
├── README.md | ||
├── powerproto.yaml | ||
├── using-gogo | ||
│ ├── service.pb.go | ||
│ ├── service.pb.gw.go | ||
│ └── service.proto | ||
└── using-googleapis | ||
├── service.pb.go | ||
├── service.pb.gw.go | ||
├── service.proto | ||
└── service_grpc.pb.go | ||
2 directories, 9 files | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
scopes: | ||
- ./using-gogo | ||
protoc: v3.17.0 | ||
protocWorkDir: "" | ||
plugins: | ||
protoc-gen-gogo: github.com/gogo/protobuf/protoc-gen-gogo@v1.3.2 | ||
protoc-gen-grpc-gateway: github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.5.0 | ||
repositories: | ||
GOGO_PROTOBUF: https://github.com/gogo/protobuf@226206f39bd7276e88ec684ea0028c18ec2c91ae | ||
GOOGLE_APIS: https://github.com/googleapis/googleapis@75e9812478607db997376ccea247dd6928f70f45 | ||
options: | ||
- --grpc-gateway_out=. | ||
- --grpc-gateway_opt=paths=source_relative | ||
- --gogo_out=plugins=grpc:. | ||
- --gogo_opt=paths=source_relative | ||
importPaths: | ||
- . | ||
- $GOPATH | ||
- $POWERPROTO_INCLUDE | ||
- $SOURCE_RELATIVE | ||
- $GOOGLE_APIS/github.com/googleapis/googleapis | ||
- $GOGO_PROTOBUF | ||
postActions: [] | ||
postShell: "" | ||
|
||
--- | ||
|
||
scopes: | ||
- ./using-googleapis | ||
protoc: v3.17.3 | ||
protocWorkDir: "" | ||
plugins: | ||
protoc-gen-go: google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 | ||
protoc-gen-go-grpc: google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 | ||
protoc-gen-grpc-gateway: github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.5.0 | ||
repositories: | ||
GOOGLE_APIS: https://github.com/googleapis/googleapis@75e9812478607db997376ccea247dd6928f70f45 | ||
options: | ||
- --go_out=. | ||
- --go_opt=paths=source_relative | ||
- --go-grpc_out=. | ||
- --go-grpc_opt=paths=source_relative | ||
- --grpc-gateway_out=. | ||
- --grpc-gateway_opt=paths=source_relative | ||
importPaths: | ||
- . | ||
- $GOPATH | ||
- $POWERPROTO_INCLUDE | ||
- $SOURCE_RELATIVE | ||
- $GOOGLE_APIS/github.com/googleapis/googleapis | ||
postActions: [] | ||
postShell: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
|
||
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
|
||
package powerproto.examples.using_gogo; | ||
option go_package = "github.com/storyicon/powerproto/examples/using_gogo/apis;apis"; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "com.powerproto.examples.using_gogo"; | ||
option objc_class_prefix = "BAPIMetadata"; | ||
|
||
option (gogoproto.goproto_enum_prefix_all) = false; | ||
option (gogoproto.goproto_getters_all) = false; | ||
option (gogoproto.unmarshaler_all) = true; | ||
option (gogoproto.marshaler_all) = true; | ||
option (gogoproto.sizer_all) = true; | ||
option (gogoproto.goproto_registration) = true; | ||
|
||
service Mocker { | ||
rpc Echo (EchoRequest) returns (EchoResponse) { | ||
option (google.api.http) = { | ||
post: "/echo" | ||
body: "*" | ||
}; | ||
}; | ||
} | ||
|
||
message EchoRequest { | ||
string message = 1; | ||
int64 timestamp = 2; | ||
uint32 code = 3; | ||
uint32 delay = 4; | ||
} | ||
|
||
message EchoResponse { | ||
string message = 1; | ||
int64 timestamp = 2; | ||
string server = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
|
||
package powerproto.examples.using_googleapis; | ||
option go_package = "github.com/storyicon/powerproto/examples/using_googleapis/apis;apis"; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
service Mocker { | ||
rpc Echo (EchoRequest) returns (EchoResponse) { | ||
option (google.api.http) = { | ||
post: "/echo" | ||
body: "*" | ||
}; | ||
}; | ||
} | ||
|
||
message EchoRequest { | ||
string message = 1; | ||
int64 timestamp = 2; | ||
uint32 code = 3; | ||
uint32 delay = 4; | ||
} | ||
|
||
message EchoResponse { | ||
string message = 1; | ||
int64 timestamp = 2; | ||
string server = 3; | ||
} |
Oops, something went wrong.