Expand description
pajamax-build compiles .proto files via prost and generates service
stubs and proto definitions for use with pajamax.
§Usage
The usage is very similar to that of Tonic.
-
Import
pajamaxandpajamax-buildin your Cargo.toml:[dependencies] pajamax = "0.3" prost = "0.1" [build-dependencies] pajamax-build = "0.3" -
Call
pajamax-buildin build.rs:ⓘfn main() -> Result<(), Box<dyn std::error::Error>> { pajamax_build::compile_protos_in_local(&["proto/helloworld.proto"], &["."])?; Ok(()) }If your want more options, call
prost_builddirectly withPajamaxGen:ⓘfn main() -> Result<(), Box<dyn std::error::Error>> { prost_build::Config::new() // add your options here .service_generator(Box::new(pajamax_build::PajamaxGen::Local)) .compile_protos(&["proto/helloworld.proto"], &["."]) } -
Call
pajamaxin your source code. See the local-mode examplehelloworldand dispatch-mode exampledict-storefor details.
Enums§
- Pajamax
Gen - Specify the services to be compiled in local-mode or dispatch-mode.
Functions§
- compile_
protos_ in_ dispatch - Complie protofile. Build all services as dispatch-mode.
- compile_
protos_ in_ local - Complie protofile. Build all services as local-mode.
- compile_
protos_ list_ both - Complie protofile. Build some services as local-mode and some as dispatch-mode.
- compile_
protos_ list_ dispatch - Complie protofile. Build some services as dispatch-mode and others as local-mode.
- compile_
protos_ list_ local - Complie protofile. Build some services as local-mode and others as dispatch-mode.