{"id":23974147,"url":"https://github.com/felipeaz/grpc-example","last_synced_at":"2026-04-15T11:35:47.688Z","repository":{"id":111975978,"uuid":"370525499","full_name":"felipeaz/gRPC-example","owner":"felipeaz","description":"Example of an implementation of gRPC server using Golang","archived":false,"fork":false,"pushed_at":"2021-07-15T21:47:02.000Z","size":1984,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T05:22:04.888Z","etag":null,"topics":["golang","grpc","protobuf"],"latest_commit_sha":null,"homepage":"","language":"Go","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/felipeaz.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":"2021-05-25T01:04:43.000Z","updated_at":"2022-08-02T23:25:45.000Z","dependencies_parsed_at":"2023-05-02T18:47:55.271Z","dependency_job_id":null,"html_url":"https://github.com/felipeaz/gRPC-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeaz%2FgRPC-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeaz%2FgRPC-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeaz%2FgRPC-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipeaz%2FgRPC-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipeaz","download_url":"https://codeload.github.com/felipeaz/gRPC-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240511300,"owners_count":19813236,"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":["golang","grpc","protobuf"],"created_at":"2025-01-07T05:21:53.460Z","updated_at":"2026-04-15T11:35:42.650Z","avatar_url":"https://github.com/felipeaz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is gRPC?\n\ngRPC is a Remote Procedure Call. It's a transfeer protocol (Protobuf - Protocol buffer) created by google. This protocol is based in a \"contract\" that must be followed by all the services that will use this feature.\n\nThe gRPC compiles the \"contract\" and generates the functions we need to make it work.\n\n## http1 vs gRPC (http2)\n\nHTTP1 is the most common transfer protocol which every developer knows it. It's easy to understand and manipulate data with it, but it has much more costs than gRPC in terms of performance and memory costs.\n\nThe difference on them is the format that the message is sent, which is plain text on http and binary on http2\n\nWhen the gRPC is compiled, a bin file is generated (the bin files are lighter than http1 plain texts) and because of that, this protocol can be 10 times faster than http1 to send messages and 7 times faster to send message to other services.\n\n## When should we use gRPC\n\nAs I mentioned above, the gRPC needs a contract that must be followed by the sender and receiver, because of that, it can be hard to implement with partners if they don't know how to use and implement it.\n\nThis scenario changes when we talk about microservices, those are internal services developed by the team and in that case, the implementation of gRPC can provide a considerable improvement on the services performance.\n\n## Command to generate proto \n``\nprotoc --proto_path=proto proto/*.proto --go_out=plugins=grpc:pb\n``\n\n## Testing gRPC Server\n\nTo test the gRPC feature, we must first initialize the gRPC server. You can do that by running the following command:\n\n``go run cmd/server/server.go``\n\n\n## Data Transfer\n\nWhen the gRPC server is up, open a new terminal and run the client:\n\n``go run cmd/client/client.go``\n\n## Data Transfer as Stream\n\nThe gRPC allow us to transfer data as stream (stream transfer happens at real time). I've implemented a simple fibonacci function that generates 20 numbers of fibonacci sequence to test this functionality of gRPC.\nTo run that test, open a new terminal with the gRPC server up and use the following command\n\n``go run cmd/stream/stream.go``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeaz%2Fgrpc-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipeaz%2Fgrpc-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipeaz%2Fgrpc-example/lists"}