{"id":21883079,"url":"https://github.com/fantasy-peak/frpc","last_synced_at":"2025-04-15T06:08:04.324Z","repository":{"id":230362283,"uuid":"778704521","full_name":"fantasy-peak/frpc","owner":"fantasy-peak","description":"An rpc code generation framework for c++, It supports c++17/20/23","archived":false,"fork":false,"pushed_at":"2024-11-07T02:24:42.000Z","size":176,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T06:07:59.145Z","etag":null,"topics":["cpp17","cpp20-coroutine","msgpack-rpc","rpc-framework","zmq"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fantasy-peak.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}},"created_at":"2024-03-28T08:34:03.000Z","updated_at":"2025-03-19T05:23:50.000Z","dependencies_parsed_at":"2024-05-14T03:41:41.897Z","dependency_job_id":"643f6116-bd1a-4bea-a672-e74d5287e051","html_url":"https://github.com/fantasy-peak/frpc","commit_stats":null,"previous_names":["fantasy-peak/brpc","fantasy-peak/frpc"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasy-peak%2Ffrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasy-peak%2Ffrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasy-peak%2Ffrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasy-peak%2Ffrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasy-peak","download_url":"https://codeload.github.com/fantasy-peak/frpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016627,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp17","cpp20-coroutine","msgpack-rpc","rpc-framework","zmq"],"created_at":"2024-11-28T09:39:13.260Z","updated_at":"2025-04-15T06:08:04.306Z","avatar_url":"https://github.com/fantasy-peak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# frpc\n*An rpc code generation framework for c++, It supports c++17/20/23*\n\n[![](https://github.com/fantasy-peak/frpc/workflows/ubuntu-gcc13/badge.svg)](https://github.com/fantasy-peak/frpc/actions) [![](https://github.com/fantasy-peak/frpc/workflows/ubuntu-clang20/badge.svg)](https://github.com/fantasy-peak/frpc/actions) [![](https://img.shields.io/badge/language-C%2B%2B23-yellow.svg\n)](https://en.wikipedia.org/wiki/C%2B%2B17)\n\n## Support this repository:\n\n-   ⭐ **Star the project:** Star this. It means a lot to me! 💕\n\n## Quick Start :rocket:\n* need install uuid msgpack xmake, \u003e= gcc version 13.1.0 (GCC)\n\n#### 1. compile frpc\n```\ngit clone https://github.com/fantasy-peak/frpc.git\ncd frpc\nxmake build -v -y --file=./xmake.lua\nxmake install -o . --file=./xmake.lua\n```\n#### 2. define protocol\n*[protocol example](config/config.yaml)*.\n\n#### 3. generate code\n```\n./bin/frpc -f ./config/config.yaml -t ./template/cpp -o ./out -w ./template/web --auto_sort=1 --debug=0\n```\n\n#### 4. compile test example\n```\nxmake build -v -y --file=./test_xmake.lua\nxmake install -o . --file=./test_xmake.lua\n./bin/coro_frpc_bi\n```\n\n## Docker compilation environment\n```\ngit clone https://github.com/fantasy-peak/frpc.git\ncd frpc \u0026\u0026 cd docker \u0026\u0026 make\n```\n\n## Type Mapping\n| frpc type    | c++ type           | frpc type    | c++ type           |\n|---------|--------------------|---------|--------------------|\n| bool    | bool               | f64     | double             |\n| i8      | int8_t             | f32     | float              |\n| u8      | uint8_t            | vector  | std::vector        |\n| i16     | int16_t            | option  | std::optional      |\n| u16     | uint16_t           | string  | std::string        |\n| i32     | int32_t            | map     | std::unordered_map |\n| u32     | uint32_t           | DateTime| frpc::DateTime     |\n| i64     | int64_t            | Date    | frpc::Date         |\n| u64     | uint64_t           | Time    | frpc::Time         |\n\n\n## Protocol Definition\nIt uses yaml to define interface data, Then generate a header file library.\n\n```\nproperty:\n  filename: frpc.hpp  # Generate the name of the header file library\n  namespace: frpc     # c++ namespace name\n\nInfo:\n  type: struct\n  definitions:\n    Name: { type: string, comment: \"c++ std::string type\" }\n\nBankInfo:\n  type: struct\n  definitions:\n    TestMap: { type: map\u003cbool;u32\u003e, comment: \"c++ std::unordered_map type\" }\n    TestVector: { type: vector\u003cstring\u003e, comment: \"c++ std::vector type\" }\n\nHelloWorldApi:\n  type: interface\n  pattern: bi\n  caller: HelloWorldClient\n  callee: HelloWorldServer\n  definitions:\n    hello_world:\n      web: # Generate web service definition\n        path: \"/hello/world\"\n        timeout: \"9000\"\n      inputs:\n        bank_info: {type: BankInfo}\n        blance: {type: u64}\n        date: {type: DateTime} # frpc DateTime type\n      outputs:\n        reply: {type: string}\n        info: {type: Info}\n        count: {type: u64}\n\nUniInterface:\n  type: interface\n  pattern: uni\n  caller: HelloWorldSender\n  callee: HelloWorldReceiver\n  definitions:\n    hello_world:\n      inputs:\n        in: {type: string}\n    notice:\n      inputs:\n        in: {type: i32}\n        info: {type: string}\n\nStream:\n  type: interface\n  pattern: bi_stream\n  caller: StreamClient\n  callee: StreamServer\n  definitions:\n    hello_world:\n      inputs:\n        bank_name: {type: string}\n      outputs:\n        reply: {type: string}\n```\n\n## Example\n*[c++17 bi example](test/cpp/bi.cpp)*.\n\n*[c++20 asio coroutine bi example](test/cpp/coro_bi.cpp)*.\n\n*[c++20 frpc coroutine bi example](test/cpp/coro_frpc_bi.cpp)*.\n\n*[c++20 asio coroutine bi stream example](test/cpp/bi_stream.cpp)*.\n\n*[c++17\u0026\u0026c++20 coroutine uni pubsub example](test/cpp/uni_pub_sub.cpp)*.\n\n*[c++17\u0026\u0026c++20 coroutine uni pushpull example](test/cpp/uni_push_pull.cpp)*.\n\n*[bi web server (auto generate)](out/bi_web/src/main.cpp)*.\n\n\n## Contact\n* **Issue** - You are very welcome to post questions to [issues](https://github.com/fantasy-peak/frpc/issues) list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasy-peak%2Ffrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasy-peak%2Ffrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasy-peak%2Ffrpc/lists"}