influentialpublishers / bs-grpc Goto Github PK
View Code? Open in Web Editor NEWGRPC server and client generation from a .proto file.
GRPC server and client generation from a .proto file.
protobufjs 5 has been deprecated by grpc-node and also does not support any known means of omitting an optional field's value
oneof
and a tin.field_validation:message GetUserByIdResponse {
oneof result {
UserType user = 2 [
(tin.field_validation) = "required"
];
string error = 3;
}
}
yarn test
."GetUserByIdResponse" is not defined.
It would be great to replace reason-future
in generated code with plain Js.Promise
. I have experience with @aantron/repromise
and I would like to use that but generated code forces me to have a dependency on reason
future`. Right now I'm only experimenting with the API but if it works for me I'm willing to contribute ๐
When importing a package with import
you can access custom options that are defined therein by namespacing the option with the package name of the imported .proto
file where said custom options were are defined.
For example, this works:
extend.proto:
syntax = "proto3";
package tin_extend;
/* boilerplate needed for TIN sanitization/validation/normalization */
import "google/protobuf/descriptor.proto";
extend google.protobuf.FileOptions {
string tin_module_validation = 4000;
}
extend google.protobuf.MessageOptions {
string tin_message_validation = 4000;
}
extend google.protobuf.FieldOptions {
string tin_field_validation = 4000;
}
assemblyline.proto:
syntax = "proto3";
package assemblyline;
import "extend.proto";
/* Our proto stuff */
enum WidgetCondition {
WIDGET_CONDITION_ADEQUATE = 0;
WIDGET_CONDITION_DEFECTIVE = 1;
}
enum WidgetColor {
WIDGET_COLOR_UNPAINTED = 0;
WIDGET_COLOR_RED = 1;
WIDGET_COLOR_GREEN = 2;
}
message BlankWidget {
WidgetCondition condition = 1 [
(tin_extend.tin_field_validation) = "required"
];
}
message CutWidget {
WidgetCondition condition = 1 [
(tin_extend.tin_field_validation) = "required"
];
int32 numTeeth = 2 [
(tin_extend.tin_field_validation) = "required |> numberRange(32, 63)"
];
}
message PaintedWidget {
WidgetCondition condition = 1[
(tin_extend.tin_field_validation) = "required"
];
int32 numTeeth = 2[
(tin_extend.tin_field_validation) = "required |> numberRange(32, 63)"
];
WidgetColor paintJob = 3[
(tin_extend.tin_field_validation) = "required"
];
}
message BoxOfWidgets {
repeated PaintedWidget paintedWidgets = 1;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.