Welcome to the PaaSTech Proto Definitions repository!
This repository contains the protocol buffer definitions for PaaSTech Cloud services.
This README provides instructions on how to use the proto definitions and how to add new ones.
Using the PaaSTech Proto Definitions is straightforward.
Just follow these simple steps:
- Open your
package.jsonfile in your project. - Under the
dependenciessection, add the following line:
"dependencies": {
// ...
"paastech-proto": "github:paastech-cloud/proto#main"
}You will both find .proto files and TS type definitions in the node_modules/paastech-proto/ folder.
- Open your
Cargo.tomlfile in your project. - Under the
[dependencies]section, add the following line:
[dependencies]
# ...
paastech-proto = { git = "https://github.com/paastech-cloud/proto.git", branch = "main" }Alternatively, you can specify a specific version using a commit hash:
[dependencies]
# ...
paastech-proto = { git = "https://github.com/paastech-cloud/proto.git", rev = "1520c87" }ℹ️ Note that using
revis more stable, because withbranchthe code can change at any time.
- That's it!! 🎉
You're all set to use the PaaSTech Proto Definitions in your project.
For example, you can import a specific proto package using theusekeyword:
use paastech_proto::your_proto_package;Source: The Cargo Book - Specifying dependencies from git repositories
To contribute a new proto definition, please follow these steps:
- Fork this repository or create a new branch for your changes.
- In the
proto/directory, add your.protofile. - In the
src/lib.rsfile, add a new module with the name of your proto package.
Make sure to include the macrotonic::include_proto!()in this module. - In the
build.rsfile, add a line to compile your proto file using thetonic_build::compile_protos()macro. Specify the path to your proto file in the function call. - Run
npm run generate:prototo generate the TS type definitions. - Create a pull request with your changes.
Once your pull request is reviewed and merged, your proto definition will be available for others to use.