Questions tagged [protobuf-go]

76 questions
1
vote
1 answer

Go converting ptypes/struct Value to BSON

Requirements Two services: Server - for writing blog posts to MongoDB Client - sends request to the first service The blog post has title of type string, and content which is a dynamic type - can be any JSON value. Protobuf syntax =…
Arūnas Smaliukas
  • 3,231
  • 6
  • 27
  • 46
1
vote
1 answer

How to get all Fields names in golang proto generated complex structs

I am trying to get all the fields names in the go file generated from proto. Below is the generated struct. type Action struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Types that…
1
vote
1 answer

How to get a custom go type using gogo/protobuf

My code in .proto file currently looks like this: message Category { int64 CategoryID = 1; } message Categories { repeated Category cat = 1; } When I run protoc --gogofaster_out=. *.proto the output I get is: type Category struct { …
sweapper
  • 11
  • 4
0
votes
1 answer

Bazel build error for protos with for google api dependencies

I'm getting below error when compiling proto files from bazel as my proto file import some google api's protos. Can someone point out the issue? Error 23:31:22 (18:01:22) ERROR: /tmp/bazel-build/external/model_monitoring_api/BUILD.bazel:3:14: no…
0
votes
0 answers

GRPC Reusing Without Server Running

I know there is several projects like grpc-gateway. But these projects generally just proxies the request. So you need to run grpc server on machine as well. I am trying to find a way run http server that translates http requests into grpc messages…
Rasit aydin
  • 419
  • 2
  • 6
  • 16
0
votes
0 answers

Deserializing with a runtime provided .proto schema

i'm wondering if it's possible to parse protobuf message at runtime in Go, without using protoc. The schema i want to implement is the following: there is a binary protobuf message there is a .proto text file representing internal structure of the…
dcpt
  • 81
  • 1
  • 7
0
votes
0 answers

Getting error Option "service=grpc-web" not recognized

I am using grpc with angular. My package.json: { "name": "angular13", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", "test":…
Tuvia Khusid
  • 792
  • 5
  • 15
  • 31
0
votes
0 answers

How to serialize gonum Dense matrix in protobuf?

I want to send a gonum Dense matrix in protobuf. However, I could not find a method to flatten the matrix to []float64. Is there a better way of doing this than retrieving the matrix values row by row. I know serializing row by row works, but I am…
Ruomu
  • 27
  • 3
0
votes
1 answer

how to use protobuf reflection instead of proto.GetProperties?

I'm using proto.GetProperties in "github.com/golang/protobuf@v1.5.2/proto/properties.go" to get the properties of a proto message. But The function "GetProperties" is deprecated: Deprecated: Use protobuf reflection instead. SO, how to use protobuf…
0
votes
0 answers

"invalid character '\\'' looking for beginning of value, http POST request with JSON body to gRPC http server returns empty object

I implemented grpc server with reversed http proxy gateway as per numerous examples and it works fine. I have simple protofile like syntax = "proto3"; package altconfig; option go_package = "/proto"; import…
RetVizan
  • 1
  • 1
0
votes
2 answers

Could I reuse an existing protobuf binary, when marshaling a message including it?(protobuf3)

Protobuf definations are like that: syntax = "proto3" message HugeMessage { // omitted } message Request { string name = 1; HugeMessage payload = 2; } In a situation I received a HugeMessage from somebody, and I want to pack it with…
0
votes
0 answers

How do I compare the protobuf version used to compile the .proto files and the version of the Golang library to make sure they are compatible?

I have a Golang service which uses Protobuf. The library used by Go and the version of the compiler need to be similar enough as per the documentation: Users should use generated code produced by a version of protoc-gen-go that is identical to the…
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
0
votes
1 answer

Protoc generates GRPC .pb.go and grpc.pb.go files in different directories

I have a GRPC service and associated requests declared in a file called github.com/myuser/myrepo/protos/iam/v1/service.proto. The header for this file looks like this: syntax = "proto3"; package myrepo.iam.v1; option go_package =…
Woody1193
  • 7,252
  • 5
  • 40
  • 90
0
votes
1 answer

Failure: no .proto target files found while running buf breaking even when the proto file exist

I am trying to test breaking change by running buf breaking command like this buf breaking --against '../.git#branch=master' --path grpc/path/to/protoFile.proto --error-format=json Upon running this I get an error which says Failure: no .proto…
Rajat Singh
  • 653
  • 6
  • 15
  • 29
0
votes
1 answer

How to validate protobuf messages using proto file from Go application

My use case is that I have an application producing protobuf messages. This application is getting notified with proto file content when there is a change in schema. And from that point my application has to ensure that each protobuf message meets…