{"id":22691611,"url":"https://github.com/aobaiwaki123/grpc","last_synced_at":"2026-05-15T20:04:24.096Z","repository":{"id":243773030,"uuid":"809326014","full_name":"AobaIwaki123/gRPC","owner":"AobaIwaki123","description":"実装を通じてgRPCを理解する","archived":false,"fork":false,"pushed_at":"2024-06-12T07:37:28.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T04:47:22.706Z","etag":null,"topics":["grpc"],"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/AobaIwaki123.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":"2024-06-02T11:30:01.000Z","updated_at":"2024-08-12T13:43:40.000Z","dependencies_parsed_at":"2024-06-11T04:21:59.645Z","dependency_job_id":"100d78b9-c040-4a81-8aea-78e74eaa53b2","html_url":"https://github.com/AobaIwaki123/gRPC","commit_stats":null,"previous_names":["aobaiwaki123/grpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AobaIwaki123/gRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AobaIwaki123%2FgRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AobaIwaki123%2FgRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AobaIwaki123%2FgRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AobaIwaki123%2FgRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AobaIwaki123","download_url":"https://codeload.github.com/AobaIwaki123/gRPC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AobaIwaki123%2FgRPC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33077984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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"],"created_at":"2024-12-10T01:11:45.989Z","updated_at":"2026-05-15T20:04:24.063Z","avatar_url":"https://github.com/AobaIwaki123.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC\n\n[TOC]\n\n## Getting Started: gRPCサーバーの起動と起動確認方法\n\n```sh\n[ローカルマシン上]$ docker compose up -d\n[ローカルマシン上]$ docker compose exec -it go-grpc bash\n[Docker Container内]$ go run cmd/server/main.go\n[ローカルマシン上] $ grpcurl -plaintext localhost:8080 list\n# grpc.reflection.v1.ServerReflection\n# grpc.reflection.v1alpha.ServerReflection\n# myapp.GreetingService\n```\n\n## Streaming RPCの挙動\n\n```sh\n[ローカルマシン上]$ docker compose exec -it go-grpc bash\n[Docker Container内]$ go run cmd/server/main.go\n# gRPC Client CLI\nstart gRPC Client.\n1: send Request\n2: HelloServerStream\n3: HelloClientStream\n4: HelloBiStream\n5: exit\n#### Unary RPC ####\nplease enter \u003e1\nPlease enter your name.\nhogehoge\nHello, hogehoge!\n#### Server Streaming RPC ####\nplease enter \u003e2\nPlease enter your name.\nhogehoge\nmessage:\"[0] Hello, hogehoge!\"\nmessage:\"[1] Hello, hogehoge!\"\nmessage:\"[2] Hello, hogehoge!\"\nmessage:\"[3] Hello, hogehoge!\"\nmessage:\"[4] Hello, hogehoge!\"\n#### Client Streaming RPC ####\nplease enter \u003e3\nPlease enter 5 names.\nhogehoge\nhugahuga\nbokeboke\npokepoke\nkerokero\nHello, [hogehoge hugahuga bokeboke pokepoke kerokero]\n#### Bidirectional Streaming RPC ####\nplease enter \u003e4\nPlease enter 5 names.\nhoge\nHello, hoge\nhuga\nHello, huga\nboke\nHello, boke\npoke\nHello, poke\npoka\nHello, poka\n```\n\n## ゴールーチンセーフなgRPCの実装\n\n### Client\n\n- 同一のコネクションを用いて異なるゴールーチンから異なるサービスを扱うのはゴールーチンセーフ\n\n### Stream\n\n- 異なるゴールーチンから同一のストリームに対して、`SendMsg`または`RecvMsg`を複数回呼び出すのはゴールーチンセーフではない\n- 但し、ゴールーチンAから`SendMsg`を呼び出し、ゴールーチンBから`RecvMsg`を呼び出すというようなケースはゴールーチンセーフ\n\n## 参考\n\n- [作ってわかる！ はじめてのgRPC - Zenn](https://zenn.dev/hsaki/books/golang-grpc-starting)\n- [Concurrency - grpc-go Documentation](https://github.com/grpc/grpc-go/blob/master/Documentation/concurrency.md)\n  - コネクションやストリームをごゴールーチンセーフに書くための公式ドキュメント(必読)\n- [Application Load Balancer が、gRPC ワークロードをエンドツーエンドの HTTP/2 サポート対象に - AWS Blog](https://aws.amazon.com/jp/about-aws/whats-new/2020/10/application-load-balancers-enable-grpc-workloads-end-to-end-http-2-support/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faobaiwaki123%2Fgrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faobaiwaki123%2Fgrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faobaiwaki123%2Fgrpc/lists"}