Comments (8)
Under each "available feature" in the README you could include how to use it in the protoc option.
I came here after hitting the same issue.
from vtprotobuf.
@steve-gray Vitess has been using that flag to generate our protos for a year now, and it's been working well for us. Here's a link to our Makefile:
https://github.com/vitessio/vitess/blob/main/Makefile#L243-L253
You can see that the objects passed to the flag must contain their full package namespace. Does this help fix your issues? How can we make the documentation easier to follow?
from vtprotobuf.
ok, I see now that I am supposed to use this option:
https://github.com/planetscale/vtprotobuf/blob/main/testproto/pool/pool.proto#L7
Struggling to reference the ext.proto
file correctly, but messing around with it.
from vtprotobuf.
Ok, I was able to get this to work by copying the ext.proto
file into my project and then reference it from my proto. go mod vendor
doesn't seem to want to bring this file in otherwise.
My file structure:
./pkg/tempopb/vtproto/ext.proto
./pkg/tempopb/tempo.proto
And then I am referencing it from tempo.proto
like this:
import "pkg/tempopb/vtproto/ext.proto";
Is there a better way to do this that doesn't involve forking ext.proto
into my repo?
from vtprotobuf.
@joe-elliott You can use --go-vtproto_opt=pool=<package>.<struct>
arguments to protoc
to specify exactly which generated structs should have pooling enabled. This way you don't need to use any proto extensions.
from vtprotobuf.
Yes, that's how we run the compilation in Vitess itself. Just use the --go_vtproto_opt
CLI flag to enable specific options without having to modify the original .proto
files. That will allow for fully backwards compatible ProtoBufs that can work with and without VTProtoBuf (in case you need to rollback or encounter bugs). Cheers!
from vtprotobuf.
awesome, thx all!
from vtprotobuf.
I've been unable to get these methods to compile, I've tried for type X in package y (no namespace/prefixing to do)
--go-vtproto_opt=pool=y.x --go-vtproto_opt=features=pool+marshal+unmarshal+size
but no pool helpers - it does something though, it causes the Server/Client interface types to double-generate in both the .vt.pb files and the regular .pb files. Any chance of a super minimal example @vmg to help, or if @joe-elliott you could share a working example?
I'm happy to return it back as a PR into the README.md if I can see it working.
from vtprotobuf.
Related Issues (20)
- Uncompilable code generated for repeated groups
- Duplicated code generated for GRPC client/server HOT 1
- Panic after WKT commit: assignment to entry in nil map HOT 2
- Extensions are not encoded
- docs/feature: Nested ReturnToVTPool() HOT 4
- bug: oneof field that includes bytes field yields invalid ResetVT method
- Supporting Embedded and Nullable features from gogo proto HOT 2
- bug: Broken ResetVT generation for optional message HOT 1
- bug: grpc client methods does not use qualified idents
- feature: poolable messages paths with wildcard HOT 2
- unmarshal_unsafe feature produced code does not compile: "Cannot use intStringLen (type int) as the type IntegerType" HOT 1
- Run vtproto multiple times on different files of the same package HOT 3
- bug: IsMap not checked on message field's ReturnToVTpool
- bug: UnmarshalUnsafe panics when map values are empty strings HOT 2
- Request for New Release that Includes Well-Known Type Support HOT 4
- gRPC codec has different semantic on Unmarshal than the default one HOT 1
- v0.6.0 is creating issues in ubuntu20 HOT 2
- Offering assistance and discussing upkeep / releases for vtprotobuf HOT 8
- wrong pool unmarshal slize HOT 3
- Add optional unsafe operations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtprotobuf.