Generate gRPC clients from .proto descriptor files.
Easiest way to save protoc generated gRPC Service Clients locally is with the x dotnet tool (requires .NET Core 3):
$ dotnet tool install --global x
Which will let you generate protoc clients from either a single .proto services description:
$ x proto-<lang>
services.proto
Or upload multiple .proto files by specifying a directory instead:
$ x proto-<lang>
/path/to/grpc/protos
Use -out to specify a different directory to save the protoc generated classes to, e.g:
$ x proto-<lang>
services.proto -out /path/to/dir
Local .proto files aren't necessary for ServiceStack gRPC Services with gRPC clients only needing a URL, e.g:
$ x proto-<lang>
https://todoworld.servicestack.net
Alternatively you can use curl command-line HTTP Client to download protoc generated classes in a .zip archive:
$ curl -F 'file1=@services.proto' https://grpc.servicestack.net/protoc/[lang]?zip -L -o grpc.zip
Below is a complete list of different languages supported by this public gRPC Service:
Lang | Description |
---|---|
cpp | C++ |
csharp | C# |
dart | Dart |
go | Go |
java | Java |
java-lite | Java (Lite) |
js-node | JavaScript (node.js) |
objc | Objective C |
php | PHP |
python | Python |
ruby | Ruby |
swift | Swift |
gRPC Web | |
js-closure | JavaScript (Closure) |
js-commonjs | JavaScript (CommonJS) |
ts | TypeScript |
ts-binary | TypeScript (Binary) |
Source code available on GitHub: github.com/ServiceStack/protoc-api
made with ❤ by ServiceStack