Skip to content

openswoole/protoc-gen-openswoole-grpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Swoole GRPC Compiler

.github/workflows/release.yaml

Stub code generation and GRPC .proto compiler for OpenSwoole GRPC. You can use the openswoole/protoc docker images to compile and generate PHP codes or install the GRPC protoc plugin at your local environment.

Install openswoole-grpc code generator plugin

Download package from releases page.

cp ./protoc-gen-openswoole-grpc /usr/local/bin/

Generate PHP stub codes from GRPC proto files

protoc --php_out=./src \
       --openswoole-grpc_out=./src helloworld.proto
# or
protoc --php_out=./src \
       --openswoole-grpc_out=./src \
       --plugin=protoc-gen-grpc=protoc-gen-openswoole-grpc \
       helloworld.proto

Use openswoole/protoc Docker image to generate codes

docker run -v $APP_DIR:/app openswoole/protoc

License

OpenSwoole GRPC code generator is open-sourced software licensed under the Apache 2.0 license.