Questions tagged [protoc]

protoc is the compiler for .proto files. It generates language bindings for the messages and/or RPC services from .proto files. protoc is a native executable, the scripts under this directory build and publish a protoc executable (a.k.a. artifact) to Maven repositories. The artifact can be used by build automation tools so that users would not need to compile and install protoc for their systems.

taken from google documentation

387 questions
0
votes
1 answer

Performant gRPC rich error handling in Go

Google docs propose the following model (https://cloud.google.com/apis/design/errors#error_model) for sending rich errors in gRPC but it seems that the error string is sent to the user every time. What I want to do is to send a code and then map it…
dclipca
  • 1,739
  • 1
  • 16
  • 51
0
votes
1 answer

Cli to generate protocol buffers

In my test.proto file I have as below, i.e. no field inside message HTML, how do I set a value for the _html field of message Page? message HTML{ enum Type { NO_TYPE = 0; HTML5 = 1; XHTML = 2; } } message Page{ …
0
votes
1 answer

How to accept and validate this map in gRPC protoc?

I'm sending the following POST request to my gRPC application: curl \ --request POST \ --header 'Content-Type: application/json' \ --data-raw '{ "mandatory-key1": "value1", "mandatory-key2": { "arbitrary-optional-key1": [ "b", …
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
0
votes
1 answer

Conditonal set options in proto from command line

I need to generate both generic and grpc services from a proto file, say set option cc_generic_services to true on Linux, and use a non-grpc implementation, and set option cc_generic_services to false on Windows, to use grpc services. Is there any…
Xiaofeng
  • 532
  • 7
  • 22
0
votes
1 answer

grpc-node: How to do Intra-service requests & are there any examples of intra-service requests?

Let's just say you have 2 services: Books and Customers. Let's say a customer wants to favorite a book. So the customer might make an gRPC request to the next service. How exactly can you make an RPC call from one service to another. This is the…
0
votes
1 answer

File does not reside within any path specified

I want to compile protobuf files recursively in current directory and all subdirectories. I am running the following script: D:\Code\cloudapi>for /R %i in (*) do python -m grpc_tools.protoc --python_out=. --proto_path=. %i But the only things I…
0
votes
1 answer

Const initializer 'protoimpl.EnforceVersion(20 - protoimpl.MinVersion)' is not a constant

I'm new to gRPC, trying to generate go code from protos and getting this error on the generated file Generated code with issue: // protoc-gen-go v1.25.0 // protoc v3.12.3 const ( // Verify that this generated code is sufficiently…
aclowkay
  • 3,577
  • 5
  • 35
  • 66
0
votes
1 answer

Convert protoc to Prototool.yaml

How do i convert protoc command to prototool.yaml file ? protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 todo-service.proto protoc --proto_path=api/proto/v1 --proto_path=third_party…
user1844634
  • 1,221
  • 2
  • 17
  • 35
0
votes
1 answer

Problem with Custom protobuf CodeGenerator

I am undergoing trouble writing the custom protoc plugin. I posted this question but no response. Atleast Kindly please let me know answers to few questions. I really need to do this. I havent gone past first step itself. From this question, how…
User
  • 1,186
  • 4
  • 22
  • 36
0
votes
1 answer

protoc error validator.proto: File not found

I am getting .proto File not found error in below command Command protoc -I/usr/local/include -I. \ -I/home/xxUserxx/go/pkg/mod/github.com/mwitkow/go-proto-validators@v0.3.0/ \ -I/home/xxUserxx/go/src \ …
vikas sharma
  • 83
  • 2
  • 7
0
votes
2 answers

How dynamically fill of the struct with data?

In my gRPC service, which was written in golang , I have such rpc method called CreateCity. As you can see, in this method, I want to create a new record in the database and return all the information about this record as a response. func (server…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
0 answers

How to convert json to proto message format in Javascript client side?

I need to send a JSON as request to a grpc API via Envoy. Currently, I am using setter functions from protoc auto generated code. Is there any way to directly convert json (even, deeply nested ones) to proto message and send it as request? Here's…
Srinjoy Santra
  • 121
  • 1
  • 7
0
votes
1 answer

Cannot make grpc-gateway .gw.pb and there is no error

I've written this simple go server and client which client sends two numbers, and the server replies with the sum, and it works. Now I'm trying to set up a grpc-gateway using grpc API configuration and change the client's request from GRPC to…
no746
  • 408
  • 6
  • 23
0
votes
1 answer

Running custom protoc-plugin on linux causes

I am building a custom protoc-compiler that is based on googles c++ libraries for protobuf. I ran into a strange error when running it on linux, while it runs fine on MacOS terminate called after throwing an instance of 'std::system_error' what(): …
Leo Hilbert
  • 395
  • 2
  • 12
0
votes
2 answers

Unable to build protobuf with protoc-gen-go

I just try to build 100% valid protobuf files on Windows with --go_out protoc plugin but it fails. It doesn't report any error in protobuf files. A only see the generated code as output and the --go_out error message like so:
Dr.eel
  • 1,837
  • 3
  • 18
  • 28