{"id":15925909,"url":"https://github.com/iljapavlovs/grpc-pact-go-sample","last_synced_at":"2026-04-13T08:31:26.020Z","repository":{"id":231003943,"uuid":"692025341","full_name":"iljapavlovs/grpc-pact-go-sample","owner":"iljapavlovs","description":"Example of GRPC in GO and Pact tests for GRPC","archived":false,"fork":false,"pushed_at":"2023-09-15T12:07:27.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T02:41:32.521Z","etag":null,"topics":["contract-testing","go","grpc","pact","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/iljapavlovs.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":"2023-09-15T11:56:22.000Z","updated_at":"2023-09-15T12:13:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"597f5dec-deb8-49cd-9a17-f7c1a405152e","html_url":"https://github.com/iljapavlovs/grpc-pact-go-sample","commit_stats":null,"previous_names":["iljapavlovs/grpc-pact-go-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iljapavlovs/grpc-pact-go-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iljapavlovs%2Fgrpc-pact-go-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iljapavlovs%2Fgrpc-pact-go-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iljapavlovs%2Fgrpc-pact-go-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iljapavlovs%2Fgrpc-pact-go-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iljapavlovs","download_url":"https://codeload.github.com/iljapavlovs/grpc-pact-go-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iljapavlovs%2Fgrpc-pact-go-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: 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":["contract-testing","go","grpc","pact","protobuf"],"created_at":"2024-10-06T22:20:36.342Z","updated_at":"2026-04-13T08:31:26.003Z","avatar_url":"https://github.com/iljapavlovs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Installation\n\n* Protocol Buffer Compiler Installation `protoc` \n  * The protocol buffer compiler, `protoc`, is used to compile .proto files, which contain service and message definitions.\n\n```bash\n$ brew install protobuf\n$ protoc --version  # Ensure compiler version is 3+\n```\n\n\n\n* Go Plugins\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```\n\nUpdate your PATH so that the protoc compiler can find the plugins:\n\n```$ export PATH=\"$PATH:$(go env GOPATH)/bin\"```\n\n\n## Run the example\nFrom the examples/helloworld directory:\n\n1. Compile and execute the server code:\n\n```\n$ go run greeter_server/main.go\n```\n\n\n2. From a different terminal, compile and execute the client code to see the client output:\n\n```\n$ go run greeter_client/main.go\nGreeting: Hello world\n```\n\nCongratulations! You’ve just run a client-server application with gRPC.\n\n\n## Update the gRPC service\n1. Open `helloworld/helloworld.proto` and add a new `SayHelloAgain()` method, with the same request and response types:\n\n## Regenerate gRPC code\nBefore you can use the new service method, you need to recompile the updated .proto file.\n\nWhile still in the `helloworld` directory, run the following command:\n```bash \n protoc --go_out=. --go_opt=paths=source_relative \\\n    --go-grpc_out=. --go-grpc_opt=paths=source_relative \\\n    helloworld/helloworld.proto\n```\n\n\n## Update and run the application\nYou have regenerated server and client code, but you still need to implement and call the new method in the human-written parts of the example application.\n\n### Update the server\nOpen greeter_server/main.go and add the following function to it:\n\n```\nfunc (s *server) SayHelloAgain(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {\nreturn \u0026pb.HelloReply{Message: \"Hello again \" + in.GetName()}, nil\n}\n```\n### Update the client\nOpen greeter_client/main.go to add the following code to the end of the main() function body:\n\n```\nr, err = c.SayHelloAgain(ctx, \u0026pb.HelloRequest{Name: *name})\nif err != nil {\nlog.Fatalf(\"could not greet: %v\", err)\n}\nlog.Printf(\"Greeting: %s\", r.GetMessage())\n```\n##","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filjapavlovs%2Fgrpc-pact-go-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filjapavlovs%2Fgrpc-pact-go-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filjapavlovs%2Fgrpc-pact-go-sample/lists"}