Skip to content

DigitalKin-ai/service-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Service APIs for DigitalKin

Usage

Generate clients with buf:

Ensure buf and protoc are installed on your system.

buf dep update ./proto

Rust (tonic):

Dependencies:

Install "protoc-gen-*" with cargo.

cargo install protoc-gen-prost
cargo install protoc-gen-prost-crate
cargo install protoc-gen-tonic
Generate:
buf generate proto --template proto/buf.gen.rust.yaml

Outputs will be in out/ directory.

Typescript in Browser:

Dependencies:

Install "protoc-gen-*" with npm.

npm install -g ts-proto
Generate:
buf generate proto --template proto/buf.gen.ts.yaml

Outputs will be in services/ directory.

Proto linter

Dependencies:

Install protolint with npx.

npx protolint

Lint:

protolint lint proto

Developement Hints

When using "vscode-proto3" extention in VS Code, add the following to the '.vscode/settings.json' file in order to make the import paths work.

{
  "protoc": {
    "options": ["--proto_path=proto"]
  }
}

Optionals

how to select only specific proto, use --path args

 buf generate proto --template service-apis/proto/buf.gen.py.yaml -o gen --path service-apis/proto/digitalkin/kin --path service-apis/proto/google