8000 GitHub - kwan3854/ProtocGenWebviewRpc: A protobuf code generator for webviewRpc.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kwan3854/ProtocGenWebviewRpc

Repository files navigation

protocGenWebviewRpc

Pre-requirements

Install protoc

Mac

brew install protobuf
protoc --version  # Ensure compiler version is 3+

Windows

winget install protobuf
protoc --version # Ensure compiler version is 3+

Linux

apt install -y protobuf-compiler
protoc --version  # Ensure compiler version is 3+

Usage

Basic Usage

Format

protoc \
  --plugin=protoc-gen-webviewrpc=<path to protoc-gen-webviewrpc> \
  --webviewrpc_out=<generating options>:<output directory> \
  -I. <proto file>

Javascript

npx pbjs HelloWorld.proto --es6 hello_world.js

CSharp

protoc --csharp_out=. HelloWorld.proto

Generate CSharp Server Code

protoc \
  --plugin=protoc-gen-webviewrpc=./protoc-gen-webviewrpc \
  --webviewrpc_out=cs_server:./OutCSharp \
  -I. my_service.proto

Generate CSharp Client Code

protoc \
  --plugin=protoc-gen-webviewrpc=./protoc-gen-webviewrpc \
  --webviewrpc_out=cs_client:./OutCSharp \
  -I. my_service.proto

Generate JavaScript Server Code

protoc \
  --plugin=protoc-gen-webviewrpc=./protoc-gen-webviewrpc \
  --webviewrpc_out=js_server:./OutJavaScript \
  -I. my_service.proto

Generate JavaScript Client Code

protoc \
  --plugin=protoc-gen-webviewrpc=./protoc-gen-webviewrpc \
  --webviewrpc_out=js_client:./OutJavaScript \
  -I. my_service.proto

Generate Multiple Code

protoc \
  --plugin=protoc-gen-webviewrpc=./protoc-gen-webviewrpc \
  --webviewrpc_out=cs_client,cs_server,js_client,js_server:./All \
  -I. my_service.proto

About

A protobuf code generator for webviewRpc.

Resources

Stars

Watchers

< 4CCA h3 class="sr-only">Forks

Packages

No packages published

Contributors 2

  •  
  •  
0