Unable to build protobuf to go endpoint

protoc-gen-go needs to be in your shell path, i.e. one of the directories listed in the PATH environment variable, which is different from the Go path. You can test this by simply typing protoc-gen-go at the command line: If it says “command not found” (or similar) then it’s not in your PATH.

How do I represent a UUID in a protobuf message?

You should probably use string or bytes to represent a UUID. Use string if it is most convenient to keep the UUID in human-readable format (e.g. “de305d54-75b4-431b-adb2-eb6b9e546014”) or use bytes if you are storing the 128-bit value raw. (If you aren’t sure, you probably want string.) Wrapping the value in a message type called UUID … Read more

Java: JSON -> Protobuf & back conversion

As mentioned in an answer to a similar question, since v3.1.0 this is a supported feature of ProtocolBuffers. For Java, include the extension module com.google.protobuf:protobuf-java-util and use JsonFormat like so: JsonFormat.parser().ignoringUnknownFields().merge(json, yourObjectBuilder); YourObject value = yourObjectBuilder.build();

Handling null values in protobuffers

Disclaimer: Answer from a Googler using protobufs on a daily basis. I’m by no means representing Google in any way. Name your proto Person instead of PersonProto or ProtoPerson. Compiled protobufs are just class definitions specified by the language you are using, with some improvements. Adding “Proto” is extra verbosity. Use YourMessage.hasYourField() instead of YourMessage.getYourField() … Read more

Why are there no custom default values in proto3?

My understanding is that proto3 no longer allows you to detect field presence and no longer supports non-zero default values because this makes it easier to implement protobufs in terms of “plain old structs” in various languages, without the need to generate accessor methods. This is perceived as making Protobuf easier to use in those … Read more

How to get top-level protobuf enum value name by number in python?

Assuming the generated python is located in File_pb2.py code Try this: file_pb2._TEST.values_by_number[1].name In your case, this should give ‘ONE’ The reverse is : file_pb2._TEST.values_by_name[‘ONE’].number will give 1. EDIT: As correctly pointed by @dyoo in the comments, a new method was later introduced in protobuf library: file_pb2.Test.Name(1) file_pb2.Test.Value(‘One’) EDIT: This has changed again in proto3. Now … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)