This repo containes protobuf files and Go generated code for the NoCloud APIs.
At your project(where go.mod is):
go get github.com/slntopp/nocloud-proto@latest- Clone this repo
- Navigate to cloned repo directory
Just run:
docker run -it \
-v $(pwd):/go/src/github.com/slntopp/nocloud-proto \
ghcr.io/slntopp/nocloud/buf:latestSet up buf, follow Dockerfile for additional dependencies.
Run buf generate
Check according module for buf, add it to buf.gen.yaml, run buf generate.
If you're generating using Docker, you'd have to build image first.
buf.gen.ts.yaml as well as generated code can be found in this repo.
To regenerate code, you would need to have dependencies listed in dependencies.json installed, as well as protoc-gen-js, which can either be installed using brew install protobuf@3 or downloaded as binary from Releases here.
Once you're all set up, run:
buf generate --template buf.gen.ts.yamlSee examples/ts for Example in TypeScript.
buf.gen.php.yaml as well as generated code can be found in this repo.
In order to regenerate code, you would need to have grpc_php_plugin.
Follow the offical manual from Google to install all the necessary tools
You need the grpc_php_plugin to generate the PHP client stub classes. This plugin works with the main protoc binary to generate classes that you can import into your project.
You can build grpc_php_plugin with cmake (mind that you have to replace RELEASE_TAG_HERE):
git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
cd grpc
git submodule update --init
mkdir -p cmake/build
cd cmake/build
cmake ../..
make protoc grpc_php_pluginPut grpc_php_plugin to /usr/local/bin or another directory
It is necessary to change the
pathoption inbuf.gen.php.yamlifgrpc_php_pluginlocation differs from/usr/local/bin
buf.gen.ts.yaml can be found in this repo.
In order to regenerate code, you would need to have protoc_gen_dart which can be obtained with dart pub.