square / goprotowrap Goto Github PK
View Code? Open in Web Editor NEWA package-at-a-time wrapper for protoc, for generating Go protobuf code.
License: Apache License 2.0
A package-at-a-time wrapper for protoc, for generating Go protobuf code.
License: Apache License 2.0
It would be nice to generate dot output to illustrate cycles. It could prompt the user to paste it into https://mdaines.github.io/viz.js/
Example current output:
square/up/protos/squareup/omnibus/api_attempt_failed_bill_classification;api_attempt_failed_bill_classification --> square/up/protos/squareup/omnibus/api;api
squareup/omnibus/api/attempt_failed_bill_classification.proto imports squareup/omnibus/api/options.proto
square/up/protos/squareup/omnibus/api_resolve_failed_bill;api_resolve_failed_bill --> square/up/protos/squareup/omnibus/api;api
squareup/omnibus/api/resolve_failed_bill.proto imports squareup/omnibus/api/options.proto
square/up/protos/squareup/omnibus/api_classify_failed_bill;api_classify_failed_bill --> square/up/protos/squareup/omnibus/api;api
squareup/omnibus/api/classify_failed_bill.proto imports squareup/omnibus/api/options.proto
square/up/protos/squareup/omnibus/api_list_failed_bill_audit_logs;api_list_failed_bill_audit_logs --> square/up/protos/squareup/omnibus/api;api
squareup/omnibus/api/list_failed_bill_audit_logs.proto imports squareup/omnibus/api/options.proto
square/up/protos/squareup/omnibus/api;api --> square/up/protos/squareup/omnibus/api_list_failed_bill_audit_logs;api_list_failed_bill_audit_logs
squareup/omnibus/api/service.proto imports squareup/omnibus/api/list_failed_bill_audit_logs.proto
square/up/protos/squareup/omnibus/api;api --> square/up/protos/squareup/omnibus/api_classify_failed_bill;api_classify_failed_bill
squareup/omnibus/api/service.proto imports squareup/omnibus/api/classify_failed_bill.proto
squareup/omnibus/api/service.proto imports squareup/omnibus/api/create_internal_legacy_refund.proto
squareup/omnibus/api/service.proto imports squareup/omnibus/api/approve_refund.proto
squareup/omnibus/api/service.proto imports squareup/omnibus/api/reject_refund.proto
square/up/protos/squareup/omnibus/api;api --> square/up/protos/squareup/omnibus/api_resolve_failed_bill;api_resolve_failed_bill
squareup/omnibus/api/service.proto imports squareup/omnibus/api/resolve_failed_bill.proto
square/up/protos/squareup/omnibus/api;api --> square/up/protos/squareup/omnibus/api_attempt_failed_bill_classification;api_attempt_failed_bill_classification
squareup/omnibus/api/service.proto imports squareup/omnibus/api/attempt_failed_bill_classification.proto
Example dot output:
digraph G {
subgraph cluster_2 {
node [style=filled];
label = "api_attempt_failed_bill_classification";
"attempt_failed_bill_classification.proto";
}
subgraph cluster_3 {
node [style=filled];
label = "api_resolve_failed_bill";
"resolve_failed_bill.proto";
}
subgraph cluster_4 {
node [style=filled];
label = "api_classify_failed_bill";
"classify_failed_bill.proto";
"approve_refund.proto";
"reject_refund.proto";
"create_internal_legacy_refund.proto";
}
subgraph cluster_5 {
node [style=filled];
label = "api_list_failed_bill_audit_logs";
"list_failed_bill_audit_logs.proto";
}
subgraph cluster_6 {
node [style=filled];
label = "api";
"service.proto";
"options.proto";
}
"attempt_failed_bill_classification.proto" -> "options.proto";
"resolve_failed_bill.proto" -> "options.proto";
"classify_failed_bill.proto" -> "options.proto";
"list_failed_bill_audit_logs.proto" -> "options.proto";
"service.proto" -> "list_failed_bill_audit_logs.proto";
"service.proto" -> "classify_failed_bill.proto";
"service.proto" -> "create_internal_legacy_refund.proto";
"service.proto" -> "approve_refund.proto";
"service.proto" -> "reject_refund.proto";
"service.proto" -> "resolve_failed_bill.proto";
"service.proto" -> "attempt_failed_bill_classification.proto";
}
protowrap will generate go files to a directory which resembles the go package of pb file.
Example:
syntax = "proto3";
package foo;
option go_package = "github.com/xyz/project/foo";
When compiled, will generate go files in a relative directory./github.com/xyz/project/foo/foo.pb.go
.
This is not suitable for projects which use Go modules because the package path does not need to match the actual filesystem path of the project.
I temporarily resolved this issue by moving generated files into the right directory after they're generated
I'm interested in using this, but I'm not really sure how my proto files should be organized. I'm getting the error:
Error: proto file "<the file>" must have a lexicographical prefix of one of the import directories
Can you update the readme with some examples?
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.