Questions tagged [protobuf-go]

76 questions
0
votes
0 answers

Store protoc-gen-go generated struct to Firestore ignoring specific fields

I have such a Document message that is being stored in Google Cloud Firestore: message Document { string resource_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; string title = 2; } Setting such a Document to a firestore.DocumentRef…
0
votes
1 answer

When I'm trying to compile the Protobuf in golang, It's showing '"int" is not defined.'

While compiling the proto file, I'm getting '"int" is not defined'. 'test.proto' file syntax = "proto3"; package test; option go_package = "/;test"; message User { string FirstName = 1; string LastName = 2; string Address = 3; int…
0
votes
0 answers

Would it be possible to use golang protobuf client to call C++ protobuf server?

I need to use an existing C++ backed protobuf server (need to connect with unix socket) to receive protobuf requests. And I want to use golang as the protobuf client to send request to the server. However I found the autogenerated message definition…
cynkiller
  • 73
  • 9
0
votes
1 answer

Grpc Go Generated.pb.go import was not formatted

I imported proto file (validator.proto) from one of my project https://github.com/maanasasubrahmanyam-sd/customValidation to another project (test.proto) https://github.com/maanasasubrahmanyam-sd/customeValTest/tree/master/interfaces/test_server go…
Maana
  • 640
  • 3
  • 9
  • 22
0
votes
2 answers

GoLang Protobuf: How to send multiple messages using the same tcp connection?

I am using GoLang protobuf for encoding (and decoding) messages that are sent through a single tcp connection. The .proto struct message Prepare{ int64 instance = 1; int64 round = 2; int64 nodeId = 3; } Then I use the protoc tool to…
Pasindu Tennage
  • 1,480
  • 3
  • 14
  • 31
0
votes
1 answer

protoc Go Package Command Local Overwrite?

Following the Quick Start gRPC Go guide on the official gRPC website it has a step which asks the user to recompile the updated .proto file using this command: $ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=.…
PJConnol
  • 119
  • 1
  • 9
0
votes
1 answer

Protoc-gen-gogo compiler issue with go

Step 1:- add following dependencies github.com/gogo/protobuf/proto [ok] github.com/gogo/protobuf/protoc-gen-gogo[ok] github.com/gogo/protobuf/gogoproto[ok] google.golang.org/grpc[ok] Step 2:- create proto file in a project Step…
Ali Hassan
  • 39
  • 1
  • 12
0
votes
1 answer

not receiving error from remote call, goes all the way to timeout Go gRPC + micro + protobuf

I've recently started learning microservices using Go and I've stumbled upon some tutorial that was using micro, gRPC and protobuf. After some time I realized that I do not receive any error messages from the cli that was created to communicate with…
0
votes
1 answer

How can I test if an element is of type Any

How can I test if an element of a structure is of type Any (protobuf): *any.Any, in Go? I want to go through each element of a structure, and do a switch case depending on the type of the element. Here is the field descriptor of the…
0
votes
0 answers

How to avoid duplication of protobuf and generated code

Is there any chance to avoid code duplication on Go in .proto and .go files when using gRPC? We need to store both two versions of the code - generated and source…
0
votes
1 answer

Insert document into mongodb with one field having dynamic structure

I'm trying to insert to MongoDB with Go where one field will have dynamic data. In my case, it will come from the other service through gRPC but I simplified example to this: package main import ( "context" "fmt" _struct…
Arūnas Smaliukas
  • 3,231
  • 6
  • 27
  • 46
0
votes
1 answer

How to set optional parameter after unmarshalling Protobuf ( proto2 ) in Golang?

I have 5 fields in protobuf ( 3 required fileds and 2 optional fileds ). From producer end i will send 3 required fileds (marshall) and get those (unmarshall) 3 required fileds at consumer end. Now, i want to add those two optional parameters values…
Vani Polnedi
  • 595
  • 2
  • 4
  • 19
0
votes
0 answers

Permission denied when attempting to access generated protobufs using Uber Prototool

I am attempting to play around with https://github.com/uber/prototool that i came across. I created a simple repo called protobufs and wrote a simple script to generate my proto files in a docker container that pulls the image uber-prototool. Code…
EI-01
  • 1,075
  • 3
  • 24
  • 42
0
votes
1 answer

How to have standard serialization output between GO and JS with regards to default values?

I take a piece of data and put it in a protobuf in both GO and JS and then encode the PB on each platform and the resulting serialized values differ. Since we use the encoded value for signing and hashing, it's critical they match. From what I could…
robmisio
  • 1,066
  • 2
  • 12
  • 20
0
votes
1 answer

How to retrieve probuf from C library

I'm trying to communicate with a C library from Go using Google Protocol Buffers, but I can't make it work. I'm facing an error trying to send the protobuf into the C library I'll post the minimum code to reproduce the error I'm facing right now…
jgsogo
  • 706
  • 1
  • 9
  • 18