{"id":20003526,"url":"https://github.com/nathanborror/swift-grpc","last_synced_at":"2025-05-04T15:35:03.043Z","repository":{"id":66667386,"uuid":"69719377","full_name":"nathanborror/swift-grpc","owner":"nathanborror","description":"🔮 A very simple gRPC library to use with Apple's swift-protobuf.","archived":false,"fork":false,"pushed_at":"2017-01-24T21:12:50.000Z","size":31,"stargazers_count":30,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T08:06:42.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanborror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-10-01T04:28:31.000Z","updated_at":"2023-07-09T01:07:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8238437-fc34-4301-ad5d-be17cc582a61","html_url":"https://github.com/nathanborror/swift-grpc","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanborror%2Fswift-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanborror","download_url":"https://codeload.github.com/nathanborror/swift-grpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252357441,"owners_count":21735145,"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":[],"created_at":"2024-11-13T05:26:04.217Z","updated_at":"2025-05-04T15:35:03.033Z","avatar_url":"https://github.com/nathanborror.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift gRPC\n\nA very simple [gRPC][1] library to use with Apple's [swift-protobuf][2].\n\n---\n\n:warning: There is active work going on here that will result in API changes. :warning:\n\n---\n\n## Usage\n\nProtobuf outline:\n\n```protobuf\nsyntax = \"proto3\";\n\nservice HelloService {\n  rpc Send(HelloRequest) returns (HelloResponse) {}\n}\n\nmessage HelloRequest {\n  string text = 1;\n}\n\nmessage HelloResponse {\n  string text = 1;\n}\n```\n\nBuild protobuf file with [swift-protobuf-plugin](https://github.com/apple/swift-protobuf-plugin) and whatever server-side plugin of your choosing, here I'm using Go:\n\n    $ protoc --swift_out=YourSwiftClient/Sources --go_out=plugins=grpc:. your-protobuf-file.proto\n\nClient code:\n\n```swift\nimport Foundation\n\nlet url = URL(string: \"http://localhost:8080\")!\nlet session = GrpcSession(url: url)\n\nlet hello = HelloRequest(text: \"Hello, World\")\n\ntry? session.write(path: \"/HelloService/Send\", data: hello) { bytes in\n    let resp = try? HelloResponse(protobufBytes: bytes)\n    print(resp)\n}\n```\n\n[1]:http://www.grpc.io\n[2]:https://github.com/apple/swift-protobuf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanborror%2Fswift-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanborror%2Fswift-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanborror%2Fswift-grpc/lists"}