New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Well Known Types not supported by gofast_out #325
Comments
Yes for timestamp you will be required to use gogofast. If you would like to help by providing a pull request to support timestamp in gofast, that will be more than welcome. But I guess that most users of gofast will move over to gogofaster and gogoslick and eventually even more custom usages very quickly. |
Ah, I see :) thank you! |
There is a gogo extension to also register to golang/protobuf for this
usecase. I can't remember the name. Sorry walking home
…On Wed, 16 Aug 2017, 18:11 Nick K, ***@***.***> wrote:
Ah, I see :) thank you!
We can't switch over to gogo* sadly since it breaks gRPC reflection and
enums encoder in vanilla pbjson due to different registries.
I'll see what I can do in the spare time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#325 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLeoqy3fGWnTLW6aStiPtZWm7jshLks5sYxS9gaJpZM4O5IIg>
.
|
It is called goproto_registration
Will that help?
…On Wed, 16 Aug 2017, 18:27 Walter Schulze, ***@***.***> wrote:
There is a gogo extension to also register to golang/protobuf for this
usecase. I can't remember the name. Sorry walking home
On Wed, 16 Aug 2017, 18:11 Nick K, ***@***.***> wrote:
> Ah, I see :) thank you!
> We can't switch over to gogo* sadly since it breaks gRPC reflection and
> enums encoder in vanilla pbjson due to different registries.
> I'll see what I can do in the spare time.
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#325 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ABvsLeoqy3fGWnTLW6aStiPtZWm7jshLks5sYxS9gaJpZM4O5IIg>
> .
>
|
Thanks, I'll try that. |
When I do |
I didn't know you could do I forgot that you also need to import the timestamp.proto from the gogoprotobuf repo. It is binary compatible with the protoc timestamp.proto Hopefully this helps? |
Did it like that:
Import is
|
Could you try adding M parameters like in this test |
Thank you! Works with that one. |
I agree, this issue should stay open. I would welcome a pull request. I just warn you that its not a small amount of work, but its doable. If you would like to maybe give your final command line, that might help future developers with the same problem. If you could also include and example proto file especially with the imports, I think that would also be of great help. |
I found this thread useful, as I had the same problem.
|
I'm managing dependencies using dep; related to that I was having some issues with the code generated by --grpc-gateway_out proto/broker.pb.gw.go:12:2: cannot find package "google/protobuf" in any of:
.../go/src/github.com/fairbank-io/platform/vendor/google/protobuf (vendor tree)
/usr/local/Cellar/go/1.9.2/libexec/src/google/protobuf (from $GOROOT)
.../go/src/google/protobuf (from $GOPATH)
make: *** [build] Error 1 I leave here the Make configuration I'm using to solve it in case is useful. proto: ## Compile protocol buffers and RPC services
@protoc \
-I=./vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
-I=./vendor/github.com/gogo/protobuf/protobuf \
-I=./vendor/github.com/gogo/protobuf \
-I=./vendor \
-I=. \
--gogofast_out=\
Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,\
Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,\
plugins=grpc:. \
--grpc-gateway_out=\
Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,\
logtostderr=true:. \
-oproto/service.desc \
proto/*.proto |
Could you include the go file or the imports of the go file that is causing the compilation error? |
For reference, I don't think importing the |
You should include Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types as --gogofaster_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types, ... Also, add -I=path of directory contains timestamp.proto, on window is protoc-3.5.1-win32\include\google\protobuf |
I wonder if there would be some value to transparently falling back to the standard marshalling strategy for marshalling types. There's a real interest in the community in getting the benefits of custom code marshalling for your own code while staying as compatible as possible with |
Add (gogoproto.stdtime) = true tag in proto file. e.g.
|
Hi! I've got a protofile like that:
that is compiled using
gofast
:protoc -I/usr/local/include -I. -I /home/u/go/src -I vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --proto_path . --proto_path vendor/ --gofast_out=plugins=grpc:. --goclay_out=:. endpoint/pb/*.proto
I'm getting these errors:
in generated file there's import
import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp"
It'll compile if I'd change it to
import google_protobuf1 "github.com/gogo/protobuf/types"
.I suspect there's a problem w/ my imports. What should I change?
The text was updated successfully, but these errors were encountered: