草庐IT

protobuf-csharp-port

全部标签

json - 如何使用 jsonpb 将 JSON 解码为包含一个定义的 protobuf?

我目前无法解码jsonpb生成的JSON片段。也许这只是我的某种误解,但在查看测试时我希望它能以某种方式工作。这是pb.proto的相关片段:syntax="proto3";packagepb;messageParameter{stringname=1;oneofvalue{stringstr_value=2;int32int_value=3;boolbool_value=4;floatfloat_value=5;}}messageParameterSet{bytesraw=1;repeatedParameterparameters=2;}messageParameterSets{ma

go - 如何在 Go 中设置/获取 protobuf 的扩展字段?

我是一名Go语言开发人员。我们的团队选择使用ProtocolBuffer来转换数据。我选择了这个protobuf包:https://github.com/golang/protobuf.但是,这个包没有方法来处理ProtocolBuffer中的extensions字段。我只在protoc生成的类文件中找到了这段代码:varE_Height=&proto.ExtensionDesc{ExtendedType:(*Person)(nil),ExtensionType:(*int32)(nil),Field:110,Name:"eg.Height",Tag:"varint,110,opt",

go - 如何在 Go 中设置/获取 protobuf 的扩展字段?

我是一名Go语言开发人员。我们的团队选择使用ProtocolBuffer来转换数据。我选择了这个protobuf包:https://github.com/golang/protobuf.但是,这个包没有方法来处理ProtocolBuffer中的extensions字段。我只在protoc生成的类文件中找到了这段代码:varE_Height=&proto.ExtensionDesc{ExtendedType:(*Person)(nil),ExtensionType:(*int32)(nil),Field:110,Name:"eg.Height",Tag:"varint,110,opt",

go - 为 protobuf 消息字段定义自定义 go struct 标签

我是grpc的新手,一直在尝试从网络服务器获取json响应。然后stub可以从rpc服务器请求json。在我的.proto文件中,我创建了一个消息类型:messagePost{int64number=1;stringnow=2;stringname=3;}但是我无法编码number字段,因为protoc会生成带有number的结构pb.go文件标签:{"no":"23","now":"12:06:46","name":"bob"}我怎样才能强制Message使用消息字段的小写名称以外的标记进行“转换”?比如使用json标签no,即使Message中的字段名是number。

go - 为 protobuf 消息字段定义自定义 go struct 标签

我是grpc的新手,一直在尝试从网络服务器获取json响应。然后stub可以从rpc服务器请求json。在我的.proto文件中,我创建了一个消息类型:messagePost{int64number=1;stringnow=2;stringname=3;}但是我无法编码number字段,因为protoc会生成带有number的结构pb.go文件标签:{"no":"23","now":"12:06:46","name":"bob"}我怎样才能强制Message使用消息字段的小写名称以外的标记进行“转换”?比如使用json标签no,即使Message中的字段名是number。

go - 如何使用 google.protobuf.timestamp 和 cassandra

我正在使用“google/protobuf/timestamp.proto”在golang结构中定义时间戳类型:import"google/protobuf/timestamp.proto";messageUser{stringid=1;...google.protobuf.Timestampcreated_at=12;google.protobuf.Timestampupdated_at=13;google.protobuf.Timestamplast_login=14;}当使用cqlx插入到cassandra时:req.CreatedAt=ptypes.TimestampNow()

go - 如何使用 google.protobuf.timestamp 和 cassandra

我正在使用“google/protobuf/timestamp.proto”在golang结构中定义时间戳类型:import"google/protobuf/timestamp.proto";messageUser{stringid=1;...google.protobuf.Timestampcreated_at=12;google.protobuf.Timestampupdated_at=13;google.protobuf.Timestamplast_login=14;}当使用cqlx插入到cassandra时:req.CreatedAt=ptypes.TimestampNow()

fatal: 无法访问 https://github.com/ :Failed to connect to github.com port 443: 拒绝连接的解决办法

最近在ubuntu20.04安装PCL1.9.1的过程中,在从github下载pcl时遇到了fatal:无法访问https://github.com/PointCloudLibrary/pcl.git/:Failedtoconnecttogithub.comport443:拒绝连接这个问题。解决办法:在终端输入sudogedit/etc/hosts,打开/etc/hosts文件,然后注释掉所有只涉及到github.com的行(注意是只有github.com,有任何别的都不可以)即可解决。 

Git报错: Failed to connect to github.com port 443 解决方案

两种情况:第一种情况自己有vpn,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理第二种情况没有vpn,这时可以去某些网站上找一些代理ip+port解决办法:配置http代理Windows、Linux、MacOS中git命令相同:配置socks5代理gitconfig--globalhttp.proxysocks5127.0.0.1:7890gitconfig--globalhttps.proxysocks5127.0.0.1:7890配置http代理gitconfig--globalhttp.proxy127.0.0.1:7890gitconfig--globa

已解决—The connection to the server localhost:8080 was refused - did you specify the right host or port

运行 kubectlgetnamespace时报错:[root@ip-10-0-0-8~]#kubectlgetnamespaceE032007:39:20.86642532422memcache.go:265]couldn'tgetcurrentserverAPIgrouplist:Get"http://localhost:8080/api?timeout=32s":dialtcp127.0.0.1:8080:connect:connectionrefused....Theconnectiontotheserverlocalhost:8080wasrefused-didyouspecifyt