proto

How to create GRPC client directly from protobuf without compiling it into java code

孤人 提交于 2021-02-08 06:29:14
问题 When working with GRPC, we need to generate the gRPC client and server interfaces from our .proto service definition via protocol buffer compiler (protoc) or using Gradle or Maven protoc build plugin. Flow now: protobuf file -> java code -> gRPC client. So, is there any way to skip this step? How to create a generic GRPC client that can call the server directly from the protobuf file without compile into java code? Or, is there a way to Generated Code at runtime? Flow expect: protobuf file ->

Import and usage of different package files in protobuf?

我与影子孤独终老i 提交于 2021-02-04 21:59:05
问题 I have imported an other proto which having different package name than mine. For usage of messages from other package, have accessed that message with package name. For Example : other.proto package muthu.other; message Other{ required float val = 1; } myproto.proto package muthu.test; import "other.proto"; message MyProto{ required string str = 1; optional muthu.other.Other.val = 2; } Is there a way to use val of muthu.other package directly like optional val = 2; instead of using muthu

Streaming data with ProtoBuf to log file with a header

徘徊边缘 提交于 2021-01-27 23:18:05
问题 I am trying to stream data to a log file on an SD card on a microcontroller that reads from some sensors and stores the value in the file. To serialize the data I will be using NanoPB, the protobuf implementation for C which is quite resource efficient. The log file has the following structure: It needs to write a short header composed of a GUID, and a firmware version. After the header, the stream of data should be continuous and it should log the fields from the sensors but not the header

How to solve “AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key”?

自闭症网瘾萝莉.ら 提交于 2020-07-18 09:19:45
问题 I encountered it while executing from object_detection.utils import label_map_util in jupyter notebook. It is actually the tensorflow object detection tutorial notebook(it comes with the tensorflow object detection api) The complete error log: AttributeError Traceback (most recent call last) <ipython-input-7-7035655b948a> in <module> 1 from object_detection.utils import ops as utils_ops ----> 2 from object_detection.utils import label_map_util 3 from object_detection.utils import

In a proto, how can I define a map as a custom option

試著忘記壹切 提交于 2020-04-16 02:43:24
问题 In my proto file, I want to define a map as a custom option, tried a few things but none is working. my metadata proto file: syntax = "proto2"; import "google/protobuf/descriptor.proto"; package com.util; option java_package = "com.util"; message MyMeta { optional bool needValidation = 1; map<string, string> fileMap = 2; } extend google.protobuf.FieldOptions { optional MyMeta meta = 80412; } my proto file syntax = "proto3"; package com.test; import "util/meta.proto"; import "google/protobuf

How to enable google.protobuf.Timestamp mapping from json to proto in Jackson mixin

本小妞迷上赌 提交于 2020-01-06 08:09:02
问题 We are working in an backend application in which we use Protobuffers as model/pojo files. We have to call an API which returns a response as a JSON. message Example{ string id = 1; string another_id = 2; int32 code = 3; string name = 4; Timestamp date =5; } Now we need to call an API which returns response in JSON: { "json_id":"3", "json_another_id":"43", "code":34, "json_name":"Yeyproto", "json_date":"2018-01-01T10:00:20.021-05:00" } I am mapping the response(which is in json) directly with

How to enable google.protobuf.Timestamp mapping from json to proto in Jackson mixin

点点圈 提交于 2020-01-06 08:07:43
问题 We are working in an backend application in which we use Protobuffers as model/pojo files. We have to call an API which returns a response as a JSON. message Example{ string id = 1; string another_id = 2; int32 code = 3; string name = 4; Timestamp date =5; } Now we need to call an API which returns response in JSON: { "json_id":"3", "json_another_id":"43", "code":34, "json_name":"Yeyproto", "json_date":"2018-01-01T10:00:20.021-05:00" } I am mapping the response(which is in json) directly with

How to determine the geom type of each layer of a ggplot2 object?

心不动则不痛 提交于 2019-12-18 03:38:29
问题 As part of an effort to remove a specific geom from a plot I've already created (SO link here), I'd like to dynamically determine the geom type of each layer of a ggplot2 object. Assuming I don't know the order in which I added layers, is there a way to dynamically find layers with a specific geom? If I print out the layers like I do below I can see that the layers are stored in a list, but I can't seem to access the geom type. library(ggplot2) dat <- data.frame(x=1:3, y=1:3, ymin=0:2, ymax=2