Skip to main content

oaas_grpc_compiler

Project description

oaas-grpc-compiler compiles gRPC proto files, with type information that can be verified using mypy, formatted with black, with the possibility of custom modules where the sources to be generated in.

The add_Type_to_server function is moved into the Servicer type as a static method: Type.add_to_server, because this is how OaaS can figure out if this is a gRPC service, or a simple service.

Usage

Usage: oaas-grpc-compiler [OPTIONS] GRPC_FILES

Options:
  --module TEXT  The module of the python package to generate
  --output TEXT  Output folder where to write the files
  --help         Show this message and exit.

Example

Proto file test.proto:

syntax = "proto3";


message Ping {
  string text = 1;
}

message Pong {
  string text = 1;
  int32 len = 2;
}

service TestService {
  rpc ping(Ping) returns (Pong) {}
  rpc ping_copy(Ping) returns (Pong) {}
  rpc ping_exception(Ping) returns (Pong) {}
}

Invocation:

oaas-grpc-compiler --module some.custom.module --output some/custom/module test.proto

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oaas_grpc_compiler-1.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page