{"id":20698749,"url":"https://github.com/zhouxingtuan/eproto","last_synced_at":"2026-03-12T19:35:10.248Z","repository":{"id":86893559,"uuid":"87602985","full_name":"zhouxingtuan/eproto","owner":"zhouxingtuan","description":"eproto is base on msgpack. support protobuf description file format (.proto). can use in Lua(C++/pure lua),javascript and C# ,C++,flutter(dart).eproto是基于msgpack的序列化协议，支持使用protobuf文件格式来定义协议，支持Lua，JavaScript，C#, C++，flutter(dart)。","archived":false,"fork":false,"pushed_at":"2025-02-15T01:21:44.000Z","size":361,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T01:37:25.522Z","etag":null,"topics":["csharp","dart","flutter","javascript","lua","msgpack","proto","protobuf","protobuf3"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhouxingtuan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-08T02:49:09.000Z","updated_at":"2025-02-15T01:21:47.000Z","dependencies_parsed_at":"2026-02-10T22:02:06.338Z","dependency_job_id":null,"html_url":"https://github.com/zhouxingtuan/eproto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhouxingtuan/eproto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouxingtuan%2Feproto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouxingtuan%2Feproto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouxingtuan%2Feproto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouxingtuan%2Feproto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhouxingtuan","download_url":"https://codeload.github.com/zhouxingtuan/eproto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhouxingtuan%2Feproto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30440000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dart","flutter","javascript","lua","msgpack","proto","protobuf","protobuf3"],"created_at":"2024-11-17T00:26:40.733Z","updated_at":"2026-03-12T19:35:10.222Z","avatar_url":"https://github.com/zhouxingtuan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eproto\neproto is base on msgpack. support protobuf description file format (.proto). can use in Lua(C++/pure lua),javascript and C#, C++,flutter(dart).eproto是基于msgpack的序列化协议，支持使用protobuf文件格式来定义协议，目前支持的语言有Lua（C++版本高效，纯Lua版本方便），JavaScript，C#，C++，flutter(dart)。\n\nlink https://github.com/zhouxingtuan/eproto\n\n# How to define a proto\n    define the proto just the same as protobuf\n\n# How to generate a proto file\n    in the tool directory, run command to gen a pb file:\n        lua gen.lua xxx.proto\n\n# How to use the lua api\n    embedded the code into your program, now support with Lua5.1/LuaJIT only:\n        eproto.cpp\n        eproto.h\n    use the api follow to register a file:\n        eproto.register_file(\"xxx.pb\")\n    user the api follow to register a buffer from pb file:\n        eproto.register(buffer)\n    encode:\n        eproto.encode(\"packageName.messageName\", tab)\n    decode:\n        eproto.decode(\"packageName.messageName\", buffer)\n    pack:\n        eproto.pack(tab)\n    unpack:\n        eproto.unpack(buf)\n\n# How to use in javascript\n\tin the tool directory, after run command to gen a pb file, you can find the js file:\n\t\txxx.js\n\tincluding the xxx.js into your codes, check the example in index.html:\n\t\t\u003cscript type=\"text/javascript\" src=\"eproto.js\" \u003e\u003c/script\u003e\n\t\t\u003cscript type=\"text/javascript\" src=\"invitemgr_client.js\" \u003e\u003c/script\u003e\n\tuse the api follow:\n\t\tvar buf = eproto.encode(\"packageName.messageName\", tab);\n\t\tvar tab = eproto.decode(\"packageName.messageName\", buf);\n\t\tvar buf = eproto.pack(tab);\n\t\tvar tab = eproto.unpack(buf);\n\t\t\n# How to Use in C#\n\tin the tool directory, after run command to gen a pb file, you can find the cs file:\n\t\txxx.cs\n\tCopy the Eproto.cs and these proto files to your project:\n\t\t WriteBuffer wb = new WriteBuffer();\n\t\t test.request req = new test.request();\n\t\t wb.Clear();\n\t\t req.Encode(wb);\n\t\t byte[] tb = wb.CopyData();\n\t\t // \n\t\t ReadBuffer rb = new ReadBuffer(tb);\n\t\t req.Decode(rb);\n\t    \n# How to Use in C++\n\tin the tool directory, after run command to gen a pb file, you can find the hpp file:\n\t\t xxx.hpp    \n    Copy eproto.hpp and these proto files to your project, and include them:\n\t\t test::request* req = test::request::New();\n\t\t eproto::Writer wb;\n\t\t wb.clear();\n\t\t req-\u003eEncode(wb);\n\t\t //\n\t\t eproto::Reader rb(wb.data(), wb.size());\n\t\t req-\u003eDecode(rb);\n\t\t test::request::Delete(req);\n    You can find some simple test in main.cpp\n    Note: C++中的message对象采用的是裸指针，需要显式New和Delete，挂载到另一个message里面的message会被连带释放，\n\t\t 可以看生成源代码中的Clear函数；由于C++中对数字、字符串、map、vector等没有nil的概念，所以和Lua中的nil\n\t\t 会不一致，C++中会给默认值，分别是数字（0）、字符串（空\"\"）、map（空表）、vector（长度为0空数组）。\n\t\t 只有message对象使用指针，NULL和nil保持了一致。这里采用了完全public的class模式（类似struct），对新手\n\t\t 不友好，容易造成内存泄漏，注意使用。\n    \n \n# How to Use in flutter(dart)\n\tin the tool directory, after run command to gen a pb file, you can find the dart file:\n\t xxx.dart\n\t Copy eproto.dart and these proto files to your project, and import them. You can use it just like C++.\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhouxingtuan%2Feproto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhouxingtuan%2Feproto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhouxingtuan%2Feproto/lists"}