在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:dpp-name/protobuf-json开源软件地址:https://github.com/dpp-name/protobuf-json开源编程语言:Python 94.8%开源软件介绍:protobuf-jsonMoved from http://code.google.com/p/protobuf-json Provide serialization and de-serialization of Google's protobuf Messages into/from JSON format. protobuf-json is written in python and depends on Google's protobuf compiler for python. Quick ExampleUsing .proto file like this: message Person {
required int32 id = 1;
required string name = 2;
optional string email = 3;
} You can encode and decode it to/from json: {
"id": 123,
"name": "person name",
"email": "[email protected]"
} More complex example: message Book {
required string title = 1;
optional float price = 2;
repeated Person authors = 3;
} {
"title": "Book example",
"price": 12.7,
"authors": [
{
"id": 123,
"name": "person name",
"email": "[email protected]"
},
{
"id": 456,
"name": "another person",
}
]
} TodoFrom version 2.3.0 protobuf protoc supports a plugin system for code generators. Plugins can generate code for new languages. TODO: write JavaScript code generator |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论