-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename & Add OpenAPI Specification Generator (#107)
* rename npm name to wechaty-grpc (#106) * add grpc http annotations (wip) * add grpc gateway image * add swagger info annotation * make payload dirty restful * fix name * add more restful endpoint definitions * fix streaming methods * better protoc tools installer script * clean openapi scripts * rename src/index -> src/mod * generate proto js files with annotation * 0.19.1
- Loading branch information
Showing
21 changed files
with
496 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,3 +94,4 @@ csharp/Wechaty.Grpc/bin/ | |
csharp/Wechaty.Grpc/nupkg/package/ | ||
csharp/Wechaty.Grpc/Properties | ||
|
||
third-party/ |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
gen/ | ||
gateway | ||
go.sum |
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 |
---|---|---|
@@ -1,46 +1,45 @@ | ||
PROTOC=protoc \ | ||
GENERATED_DIR:="${CURDIR}/../generated/" | ||
THIRD_PARTY_DIR:="${CURDIR}/../third-party/" | ||
|
||
PROTOC:=protoc \ | ||
-I ../proto/ \ | ||
-I ../proto/wechaty/ \ | ||
-I ${THIRD_PARTY_DIR} \ | ||
../proto/wechaty/puppet.proto \ | ||
|
||
.PHONY: all | ||
all: clean generate reverse_proxy_server | ||
all: generate | ||
|
||
.PHONY: generate | ||
generate: | ||
${PROTOC} \ | ||
--openapiv2_out ${GENERATED_DIR} \ | ||
--openapiv2_opt logtostderr=true \ | ||
--openapiv2_opt generate_unbound_methods=true \ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -fr gen/* | ||
rm -fr ${GENERATED_DIR}/* | ||
|
||
.PHONY: install | ||
install: | ||
[ -d gen ] || mkdir gen | ||
go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ | ||
google.golang.org/protobuf/cmd/protoc-gen-go \ | ||
google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
go mod tidy | ||
|
||
.PHONY: generate | ||
generate: gen_protobuf gen_gateway gen_openapi | ||
|
||
.PHONY: gen_protobuf | ||
gen_protobuf: | ||
${PROTOC} \ | ||
--go_out ./gen/ --go_opt paths=source_relative \ | ||
--go-grpc_out ./gen/ --go-grpc_opt paths=source_relative \ | ||
../proto/wechaty/puppet.proto | ||
--go_out ${GENERATED_DIR} --go_opt paths=source_relative \ | ||
--go-grpc_out ${GENERATED_DIR} --go-grpc_opt paths=source_relative \ | ||
|
||
.PHONY: gen_gateway | ||
gen_gateway: | ||
${PROTOC} \ | ||
--grpc-gateway_out ./gen/ \ | ||
--grpc-gateway_out ${GENERATED_DIR} \ | ||
--grpc-gateway_opt logtostderr=true \ | ||
--grpc-gateway_opt paths=source_relative \ | ||
--grpc-gateway_opt generate_unbound_methods=true \ | ||
|
||
.PHONY: gen_openapi | ||
gen_openapi: | ||
${PROTOC} \ | ||
--openapiv2_out ./gen/ \ | ||
--openapiv2_opt logtostderr=true \ | ||
|
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# GO gRPC Gateway | ||
|
||
gRPC Gateway: <https://github.com/grpc-ecosystem/grpc-gateway> | ||
- gRPC Gateway: <https://github.com/grpc-ecosystem/grpc-gateway> | ||
- Template: <https://github.com/johanbrandhorst/grpc-gateway-boilerplate> |
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
Oops, something went wrong.