- 浏览: 388597 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
You specify how you want the information you're serializing to be structured by defining protocol buffer message types in .proto files. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs. The detailed language guide can be found
As a walk-through, we create an Echo message which has three fields.
content: type is strnig and multiplicity is [1..1]
value: type is int32 and multiplicity is [0..1]
value_array: type is int32 and multiplicity is [0..*]
so with this in mind, you may come up with the following definition.
package sample; message Echo { required string content = 1; optional int32 value = 2; repeated int32 value_array = 3; }
and one word on the union approach.
A key difference between GPB and XML is that GPB messages are not self describing. This means that the process receiving the message has to know what type it is before parsing. While there are cases where there is only one type of message being sent on a connection, the majority of applications send and receive multiple types of messages. So how do you make sure that the recipient application knows how to decode your message? One solution is to create a wrapper message that has one optional field for each possible message type. For example, if you have message types Foo, Bar, and Baz, you can combine them with a type like:
message OneMessage { optional Foo foo = 1; optional Bar bar = 2; optional Echo echo = 3; }
发表评论
-
wpf - example to enhance ComboBox for AutoComplete
2014-09-19 15:56 1937first let’s see an example ... -
Investigate and troubleshoot possible memory leak issue of .NET application
2014-07-31 10:42 0Hi All, I would like to sh ... -
C# – CoerceValueCallback合并、替换元数据值
2013-08-05 21:59 1889Topic: C# – CoerceValueCallbac ... -
wpf – ListView交替背景色
2013-07-02 20:56 6490Wpf – Alternate background col ... -
C# - 简单介绍TaskScheduler
2013-06-29 17:18 11927标题: C# - 简单介绍TaskSchedulerTit ... -
c# - Get enum from enum attribute
2013-06-27 21:32 1200DescriptionAttribute gives the ... -
C# - PInvoke, gotchas on the RegisterClassEx and the CreateWindowEx
2013-06-24 13:49 2530I get an exception message li ... -
c# - Use PInvoke to create simple win32 Application
2013-06-24 11:59 10880In this post, .net platform h ... -
c# - Linq's Select method as the Map function
2013-06-19 18:47 1237If you comes from a functiona ... -
c# - Tips of Linq expression Any to determine if a collection is Empty
2013-06-19 18:29 892When you are @ the linq expres ... -
myth buster - typeof accepting array of types not acceptable
2013-06-19 17:17 780I have seen from some book whe ... -
windows - trying to create WIN32 application with PInvoke
2013-06-19 14:34 0While it is stupid to do such ... -
WPF - Setting foreground color of Entire window
2013-06-13 16:00 1880You might as well as I would s ... -
WPF - Enhanced TabControl - TabControlEx aka Prerendering TabControl
2013-06-13 13:12 5291As an opening word, let's che ... -
wpf - ControlTemplate and AddLogicChild/RemoveLogicalChild
2013-06-10 15:42 1143Recently I was trying to debug ... -
c# - P/Invoke, DllImport, Marshal Structures and Type conversions
2013-06-05 15:25 1657P/Invoke as in the following q ... -
c# - A study on the NativeWindow - encapsulate window handle and procedure
2013-06-05 14:40 6044NativeWindow gives you a way t ... -
WCF - Notify server when client connects
2013-06-03 18:19 1181It is sometimes very importan ... -
wcf - Debug to enable Server exception in Fault message
2013-06-03 15:47 1055WCF will be able to send back ... -
c# - determine if a type/object is serialzable
2013-05-30 16:35 835In WCF, primitives type are s ...
相关推荐
关于 Google Protocol Buffer的2.5.jar和 proto.exe 和IDEA的Proto插件。在开发中可以让你们省很多时间,直接通过IDEA编译Proto文件,超级方便
赠送jar包:proto-google-common-protos-1.17.0.jar; 赠送原API文档:proto-google-common-protos-1.17.0-javadoc.jar; 赠送源代码:proto-google-common-protos-1.17.0-sources.jar; 赠送Maven依赖信息文件:...
编译好的protoc 以及libprotobuf.lib、libprotobuf-lite.lib和libprotoc.lib,还有用到的头文件
开源项目-mwitkow-go-proto-validators.zip,go的声明性protobuf验证代码
资源来自pypi官网。 资源全名:wix-protos-proto-duplexer-api-proto-0.0.1.tar.gz
daas-dac-backend-2.2.0-proto.jar
daas-sabot-kernel-2.2.0-proto.jar
android-test-plugin-host-additional-test-output-proto-30.3.1-sources.jar
赠送jar包:proto-google-common-protos-1.17.0.jar; 赠送原API文档:proto-google-common-protos-1.17.0-javadoc.jar; 赠送源代码:proto-google-common-protos-1.17.0-sources.jar; 赠送Maven依赖信息文件:...
开源项目-NYTimes-openapi2proto.zip,NYTimes/openapi2proto: A tool for generating Protobuf v3 schemas and gRPC service declarations from Open API/Swagger specs
protobuf c#转换工具-支持proto2 简介:Protocol Buffers 是一种轻便高效的结构化数据存储格式,可以用于结构化数据串行化,或者说序列化。它很适合做数据存储或 RPC 数据交换格式。可用于通讯协议、数据存储等领域...
go-proto-validators, 从. proto 注释生成消息确认器 Golang ProtoBuf验证器编译器 protoc 插件,在 go struct s 基于 .proto 文件内的字段选项生成 Validate() error 函数。 验证函数是生成的代码,因此在深入嵌套...
Protocol Buffer sublime text 3插件,官方网址: https://github.com/vihangm/sublime-protobuf-syntax
怕有误人子弟之嫌,先贴上官方文档的地址,本译文仅供参考:https://developers.google.com/protocol-buffers/docs/proto3 PS:表格不好排版,采用了A3的稿纸设置,放大了才能看的更清楚。另外,意译的累,收点积分...
一个protoc插件,它基于.proto文件中的字段选项在Go proto struct上生成Validate() error函数。 验证功能是代码生成的,因此不会因对嵌套消息的基于标签的反射而影响性能。 要求 目前已验证使用Protobuf验证程序可...
google protocol buffers 官网中文教程
主要用于对protocol buffer文件,及.proto文件的编译。谢谢你的关心