{"id":13804394,"url":"https://github.com/huntlabs/grpc-dlang","last_synced_at":"2025-05-05T13:32:35.693Z","repository":{"id":32925458,"uuid":"146406965","full_name":"huntlabs/grpc-dlang","owner":"huntlabs","description":"Grpc for D programming language, hunt-http library based.","archived":false,"fork":false,"pushed_at":"2022-03-12T05:22:40.000Z","size":146,"stargazers_count":44,"open_issues_count":11,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-25T11:50:42.200Z","etag":null,"topics":["dlang","grpc","hunt","hunt-grpc","rpc"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huntlabs.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}},"created_at":"2018-08-28T07:11:13.000Z","updated_at":"2024-05-13T00:56:21.000Z","dependencies_parsed_at":"2022-08-07T18:16:22.719Z","dependency_job_id":null,"html_url":"https://github.com/huntlabs/grpc-dlang","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huntlabs%2Fgrpc-dlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huntlabs%2Fgrpc-dlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huntlabs%2Fgrpc-dlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huntlabs%2Fgrpc-dlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huntlabs","download_url":"https://codeload.github.com/huntlabs/grpc-dlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252506550,"owners_count":21759071,"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":["dlang","grpc","hunt","hunt-grpc","rpc"],"created_at":"2024-08-04T01:00:47.057Z","updated_at":"2025-05-05T13:32:35.415Z","avatar_url":"https://github.com/huntlabs.png","language":"D","funding_links":[],"categories":["Web Frameworks"],"sub_categories":["Bare metal / kernel development"],"readme":"# grpc-dlang\n\ngRPC implementation for D.\n\n### Building\n\n### Building the protocol buffer compiler for D\n```sh\n$ git clone https://github.com/dcarp/protobuf-d\n$ cd protobuf-d\n$ dub build :protoc-gen-d\n$ sudo cp build/protoc-gen-d /usr/local/bin\n```\n\n### Building the gRPC plugin for D\n\n```sh\n$ git submodule update --init --recursive\n# Update Git submodule to latest commit on origin\n# git submodule update --remote --merge\n$ cd compiler\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make -j4\n$ sudo cp deps/protobuf/protoc* /usr/local/bin\n$ sudo cp grpc_dlang_plugin /usr/local/bin\n```\n\n### Building the core library\n```sh\ncd grpc-dlang\ndub build\n```\n\n### Generating protobuf code\n```sh\nprotoc --plugin=/usr/local/bin/protoc-gen-d --d_out=./examples -I ./examples ./examples/helloworld.proto\n```\n\n### Generating grpc client and server code\n```sh\nprotoc --plugin=protoc-gen-grpc=/usr/local/bin/grpc_dlang_plugin -I ./examples --grpc_out=./examples ./examples/helloworld.proto\n```\n\n### Building the examples\n\n1. A simple demo\n```shell\n$ cd examples/SimpleDemo/proto/\n$ ./generate.sh\n$ cd ..\n$ ./build.sh \n```\n\n2. Demo for streaming\n```sh \ndub build -c=streamexample\n./streamexample -f ./examples/route_guide_db.json\n```\n\n\n## Samples\n \n### The server\n \n```D\nimport grpc;\n\nimport helloworld.helloworld;\nimport helloworld.helloworldrpc;\n\nclass GreeterImpl : GreeterBase\n{\n    override Status SayHello(HelloRequest request , ref HelloReply reply)\n    {\n        reply.message = \"hello \" ~ request.name;\n        return Status.OK;\n    }\n}\n\nstring host = \"0.0.0.0\";\nushort port = 50051;\n\nauto server = new Server();\nserver.listen(host , port);\nserver.register( new GreeterImpl());\nserver.start();\n```\n\n### The client\n```D\nimport helloworld.helloworld;\nimport helloworld.helloworldrpc;\nimport grpc;\nimport std.stdio;\n\nauto channel = new Channel(\"127.0.0.1\" , 50051);\nGreeterClient client = new GreeterClient(channel);\n\nauto request = new HelloRequest();\nrequest.name = \"test\";\n\nHelloReply reply = client.SayHello(request);\n \nif(reply !is null)\n{\n   writeln(reply.message);\n}\n```\n\n### The streaming\n\nWe implemented the offical example [RouteGuide](https://github.com/huntlabs/grpc-dlang/tree/master/examples/RouteGuideDemo).\n\n## Resources\n\n- [cpp quickstart](https://grpc.io/docs/languages/cpp/quickstart/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuntlabs%2Fgrpc-dlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuntlabs%2Fgrpc-dlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuntlabs%2Fgrpc-dlang/lists"}