{"id":20411817,"url":"https://github.com/ericvolp12/connect-interceptors","last_synced_at":"2025-03-05T03:19:02.006Z","repository":{"id":250409217,"uuid":"834396955","full_name":"ericvolp12/connect-interceptors","owner":"ericvolp12","description":"A library of interceptors for ConnectRPC that I've found handy","archived":false,"fork":false,"pushed_at":"2024-07-27T07:01:51.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T02:40:50.575Z","etag":null,"topics":["buf","connect","connectrpc","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericvolp12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-27T06:29:37.000Z","updated_at":"2025-01-29T10:39:48.000Z","dependencies_parsed_at":"2024-07-27T07:54:31.410Z","dependency_job_id":null,"html_url":"https://github.com/ericvolp12/connect-interceptors","commit_stats":null,"previous_names":["ericvolp12/connect-interceptors"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvolp12%2Fconnect-interceptors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvolp12%2Fconnect-interceptors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvolp12%2Fconnect-interceptors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvolp12%2Fconnect-interceptors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericvolp12","download_url":"https://codeload.github.com/ericvolp12/connect-interceptors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241955509,"owners_count":20048490,"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":["buf","connect","connectrpc","golang"],"created_at":"2024-11-15T05:54:06.477Z","updated_at":"2025-03-05T03:19:01.977Z","avatar_url":"https://github.com/ericvolp12.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConnectRPC Interceptors\nA library of interceptors for ConnectRPC that I've found handy\n\n## Interceptors\n\n- `pkg/retry` - An interceptor that allows you to retry RPCs that fail with specific error conditions.\n    - Supports custom backoff strategies and custom functions for parsing errors to determine if you should retry.\n    - Defaults to a 1 second backoff, 10 retry maximum, and automatic retries on connection errors.\n- `pkg/prom` - An interceptor that adds some prometheus metrics to your RPCs to track latencies and request throughput.\n    - Make sure to call `RegisterMetrics(registry)` with your prometheus registerer if you're not using the default registerer (if you are, promauto will take care of it).\n    - Feel free to fork this one and tune the buckets or add additional metrics for your service.\n\n## Using an Interceptor\n\nRead more about ConnectRPC Interceptors [here](https://connectrpc.com/docs/go/interceptors)\n\nTo plug any of these interceptors into your ConnectRPC Client or Server, you can initialize your server or client as follows:\n\n```go\nimport (\n    \"github.com/ericvolp12/connect-interceptors/pkg/retry\"\n)\n\ninterceptors := connect.WithInterceptors(retry.NewRetryInterceptor(nil, nil))\n\n// For handlers:\nmux := http.NewServeMux()\nmux.Handle(greetv1connect.NewGreetServiceHandler(\n  \u0026greetServer{},\n  interceptors,\n))\n\n// For clients:\nclient := greetv1connect.NewGreetServiceClient(\n  http.DefaultClient,\n  \"https://api.acme.com\",\n  interceptors,\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvolp12%2Fconnect-interceptors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericvolp12%2Fconnect-interceptors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvolp12%2Fconnect-interceptors/lists"}