protocol-buffers

GRPC Service Discovery

萝らか妹 提交于 2020-02-02 02:35:12
问题 Given the address of a GRPC service at, say, ipv4:127.0.0.1:25000 , are there any standardized queries or tools I can use to discover what GRPC requests the service is capable of receiving? e.g. I'm looking for something like: ./magic-grpc-service-tool 127.0.0.1:25000 > service Greeter { > rpc Greet(HelloMessage) returns (HelloResponse) {} > } 回答1: Update: the reflection service is supported across the various languages and grpc CLI is able to consume it. At the moment, no. We will be adding

Cmake cannot run shell command

二次信任 提交于 2020-01-25 08:53:08
问题 Let's assume we have a project with some subdirectories and we need to generate .cpp and .h files in one of its subdirectories. True fact: if we run a command (without < and >) in that directory, it generates valid files. So how to do the same using cmake? Cmake has add_custom_command, but it does nothing, so we cannot use it. execute_process is better because it runs something, but in a wrong way. execute_process(COMMAND "protoc -I=\".\" --cpp_out=\".\" protocol.proto" WORKING_DIRECTORY $

Protocol Buffer with CMakeLists

天涯浪子 提交于 2020-01-25 07:01:24
问题 I have a project which has src , include and some older folders under its parent dictory. I created a folder called proto , which has my VisionData.proto in it. I want to generate the expected output files, however it doesn't work. I looked at the official site of it and did whatever they wrote there, but still no luck. Here is my CMakeLists: cmake_minimum_required(VERSION 2.8.3) project(uwsim_imgproc) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT

TensorFlow Lite conversion

青春壹個敷衍的年華 提交于 2020-01-25 06:59:08
问题 I'm working with the Raspberry pi 4, to create an image detection model. I need to turn the model into a lite version since I'm installing it on a card called JeVois. I have Tensorflow 1.13.1 for Raspberry Pi. And, My problem is the following : I finished the training stage and I made the following steps to export the model in lite format: python3 export_inference_graph.py --input_type image_tensor --pipeline_config_path training/ssd_mobilenet_v1.config --trained_checkpoint_prefix training

Illegal group end indicator error in protobuf decode

旧时模样 提交于 2020-01-25 04:23:41
问题 I am getting the following error when i try to decode bytearray using protobuf.js decode error: Illegal group end indicator for Message .SampleMessage: 1749 (not a group) at Error (native) at ProtoBuf.Reflect.MessagePrototype.decode (http://127.0.0.1:53259/libs/protobuf/dist/ProtoBuf.js:3168:31) at Function.Message.decode (http://127.0.0.1:53259/libs/protobuf/dist/ProtoBuf.js:2896:37) code snippet: sample.proto - file message SampleMessage { required string text = 1; } Java code For encode:

Cmake : find protobuf package in custom directory

孤人 提交于 2020-01-24 22:43:09
问题 I have cmake 3.10.x and downloaded current protobuf sources 3.6.1. Using cmake I created bin directory "{PROTOBUF_SOURCE_DIR}/bin" where this library is successfully built. As the next step I would like to use this custom tree in my cmake based project. I have set ( Protobuf_USE_STATIC_LIBS ON ) find_package( Protobuf REQUIRED ) if ( Protobuf_FOUND ) message( STATUS "Protobuf version : ${Protobuf_VERSION}" ) message( STATUS "Protobuf include path : ${Protobuf_INCLUDE_DIRS}" ) message( STATUS

Importing .proto files from another project

荒凉一梦 提交于 2020-01-24 17:14:09
问题 I have several contract projects that contains different protobuf files, but some of the message types have the same message type like message user { Address address = 1 } message Address { .... } I have now created a shared project and added an Address.proto file to it only containing syntax = "proto3" option csharp_namespace = "shared.protos" package AddressPackage message Address {....} My problem is to figure out how to import it into the protos in my different contract projects. I have

Unable to unmarshal json to protobuf struct field

别来无恙 提交于 2020-01-24 14:21:45
问题 I have a proto file similar to this. syntax = "proto3"; package proto; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/struct.proto"; message JobCreateRequest { string Name = 1 [(gogoproto.jsontag) = "name", (gogoproto.moretags)= "validate:\"required,max=100\""]; string Description = 2 [(gogoproto.jsontag) = "description", (gogoproto.moretags) = "validate:\"required,max=100\""]; google.protobuf.Value Data = 3 [(gogoproto.jsontag) = "data", (gogoproto.moretags)

Unable to unmarshal json to protobuf struct field

末鹿安然 提交于 2020-01-24 14:21:30
问题 I have a proto file similar to this. syntax = "proto3"; package proto; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/struct.proto"; message JobCreateRequest { string Name = 1 [(gogoproto.jsontag) = "name", (gogoproto.moretags)= "validate:\"required,max=100\""]; string Description = 2 [(gogoproto.jsontag) = "description", (gogoproto.moretags) = "validate:\"required,max=100\""]; google.protobuf.Value Data = 3 [(gogoproto.jsontag) = "data", (gogoproto.moretags)

Node.js, protobuffer, buffer.lentgh.. how to send structured buffer/message trough tcp?

℡╲_俬逩灬. 提交于 2020-01-24 12:00:46
问题 I had wrote a node/ssjs program that makes: Tcp connection to data server(Apache MIMA), using TLS module. (OK) Encode/decode(serialize/deserialize) messages through protobuffer module.. (OK) Send serialized message to server and get response. (Not OK). The server´s manual types: Structure of message: [ Length | Header length | Header (| Body length |Body) ] Length – message length = fixed size (4 bytes). Note that this is only the size of following message (not the prefix itself); Header