{"id":24330864,"url":"https://github.com/feliux/grpc-calculator","last_synced_at":"2026-04-27T08:31:46.718Z","repository":{"id":223044613,"uuid":"759161287","full_name":"feliux/grpc-calculator","owner":"feliux","description":"Simple gRPC calculator implementation with SSL, login and headers interceptors","archived":false,"fork":false,"pushed_at":"2024-02-17T21:01:24.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T00:41:42.417Z","etag":null,"topics":["grpc","grpc-go"],"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/feliux.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}},"created_at":"2024-02-17T20:16:15.000Z","updated_at":"2024-02-17T21:11:32.000Z","dependencies_parsed_at":"2024-02-17T22:30:09.382Z","dependency_job_id":null,"html_url":"https://github.com/feliux/grpc-calculator","commit_stats":null,"previous_names":["feliux/grpc-calculator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/feliux/grpc-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliux%2Fgrpc-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliux%2Fgrpc-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliux%2Fgrpc-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliux%2Fgrpc-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feliux","download_url":"https://codeload.github.com/feliux/grpc-calculator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feliux%2Fgrpc-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32329463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["grpc","grpc-go"],"created_at":"2025-01-18T01:14:55.038Z","updated_at":"2026-04-27T08:31:46.660Z","avatar_url":"https://github.com/feliux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC Calculator\n\nSimple gRPC calculator implementation with SSL, login and headers interceptors.\n\n**gRPC Unary**:\n\n- `rpc Sum(SumRequest) returns (SumResponse);`\n- Error Handling: `rpc Sqrt(SqrtRequest) returns (SqrtResponse);`\n\n**gRPC Server Streaming**:\n\n- `rpc Primes(PrimesRequest) returns (stream PrimesResponse)`\n\n**gRPC Client Streaming**:\n\n- `rpc Average(stream AverageRequest) returns (AverageResponse)`\n\n**gRPC Bidirectional**:\n\n- `rpc Max(stream MaxRequest) returns (stream MaxResponse)`\n\n## Usage\n\n1. Install protobuf go plugins\n\n```bash\n$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28\n$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2\n$ export PATH=\"$PATH:$(go env GOPATH)/bin\"\n```\n\n2. Compile proto files\n\n```bash\n$ cd proto\n$ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto\n```\n\n3. Uncomment [client/main.go](./client/main.go) with the function to test\n\n```\n//DoSum(c, \u0026pb.SumRequest{FirstValue: 1, SecondValue: 1})\n//DoSumDeadline(c, \u0026pb.SumRequest{FirstValue: 1, SecondValue: 1}, 5*time.Second) // no error\n//DoSumDeadline(c, \u0026pb.SumRequest{FirstValue: 1, SecondValue: 1}, 1*time.Second) // timeout error\n//DoPrimes(c, 400)\n//DoAverage(c, []float64{1, 2, 3, 4})\n//DoMax(c, []int32{1, 5, 3, 6, 2, 20})\n//DoSqrt(c, -9)\n```\n\n4. Generate certs\n\n```bash\n$ cd ssl\n$ bash generate-certs.sh\n```\n\n5. Compile server and client\n\n```bash\n$ cd ..\n$ go build -o server/server server/*.go\n$ go build -o client/client client/*.go\n```\n\n6. Run server and client\n\n```bash\n# Run server\n$ ./server/server\n# Run client on another terminal\n$ ./client/client\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliux%2Fgrpc-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeliux%2Fgrpc-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeliux%2Fgrpc-calculator/lists"}