Issue I am new to grpc. In my go.mod file I have: google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8 google.golang.org/grpc v1.21.1 github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d github.com/golang/protobuf v1.3.2 I am generating my protobufs like this: go get google.golang.org/protobuf/cmd/protoc-gen-go go get google.golang.org/grpc/cmd/protoc-gen-go-grpc protoc –go_out=. –go-grpc_out=. ./me.proto I get the
Continue readingTag: protocol-buffers
How to get a Protobuf enum value from its string representation?
Issue I can get the string value of a Protobuf enum with this instruction: str := testPB.Status_ENABLED.String() How can I perform the inverse operation? (from a string, get the enum element). Solution The generated code has a map called <EnumName>_value
Continue readingGet the enum value out from protobuf messages
Issue Here is a protobuf message definition: message People { enum PeopleName { Alice = 100; Bob = 101; Cathy = 102; } optional PeopleName name = 1; } I would like to populate the name field based on some
Continue readingHow can I compare read(1.proto) = read(2.proto) in Go(assuming there's just one message definition)?
Issue Context: I’m trying to resolve this issue. In other words, there’s a NormalizeJsonString() for JSON strings (see this for more context: // Takes a value containing JSON string and passes it through // the JSON parser to normalize it,
Continue readingCould I reuse an existing protobuf binary, when marshaling a message including it?(protobuf3)
Issue 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
Continue readinginvalid memory address when creating grpc client request with repeated field
Issue I have an issue with my grpc server and client, I’m trying to create a repeated field in the grpc and send it to the client. but it failed on error, what am I doing wrong on my grpc
Continue readingBuilding a Docker with Multiple Proto – Proto File not found
Issue I’m running with an issue where I can’t build Dockerfile that includes multiple proto files(server and text). The server proto is within the Dockerfile dir, but the text proto is within the Dockerfile parent. So I’m building the Dockerfile
Continue readingJSON to Protobuf (v3)
Issue Noob question here. I’m still new to the Protobuf thing. How can I convert my JSON data to a Protobuf JSON? { "id": "12345678901233456", "name": "asdfghjkl", "start_time": 1.666058486989E9, "trace_id": "1-adg346-dhagjkh348762834jah37846f", "end_time": 1.666058487934E9 } I’m trying to send the fetched
Continue readingImport protobuf file from GitHub repository
Issue I currently have two protobuf repos: api and timestamp: timestamp Repo: – README.md – timestamp.proto – timestamp.pb.go – go.mod – go.sum api Repo: – README.md – protos/ – dto1.proto – dto2.proto Currently, timestamp contains a reference to a timestamp
Continue readingProtobuf dynamic message schema verification
Issue I’m trying to implement data contract logic. I’ve 2 services switching messages with each other. Service A send messages in some format + the file descriptor proto of the .proto file used to generate it. Service B gets them
Continue reading