{"id":17070678,"url":"https://github.com/connerdouglass/ezrpc","last_synced_at":"2026-05-17T15:04:49.229Z","repository":{"id":85323902,"uuid":"462841559","full_name":"connerdouglass/ezrpc","owner":"connerdouglass","description":"Tiny Go library for generic RPCs","archived":false,"fork":false,"pushed_at":"2022-05-25T14:37:29.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T01:56:27.569Z","etag":null,"topics":["generics","golang","rpc"],"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/connerdouglass.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":"2022-02-23T17:37:45.000Z","updated_at":"2022-02-23T17:39:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7260a541-d32a-4f9a-ab4a-1fe72d83917e","html_url":"https://github.com/connerdouglass/ezrpc","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/connerdouglass/ezrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connerdouglass%2Fezrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connerdouglass%2Fezrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connerdouglass%2Fezrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connerdouglass%2Fezrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connerdouglass","download_url":"https://codeload.github.com/connerdouglass/ezrpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connerdouglass%2Fezrpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33143276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["generics","golang","rpc"],"created_at":"2024-10-14T11:32:56.390Z","updated_at":"2026-05-17T15:04:49.195Z","avatar_url":"https://github.com/connerdouglass.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ezrpc\n\n`ezrpc` is a super small Go library that uses the new Go 1.18 generics to enable RPC functionality.\n\nI built this for myself so I can separate my application logic from gateway/HTTP logic.\n\n## Example\n\nEasily connect RPCs to your existing HTTP router:\n\n```go\nfunc main() {\n\n\t// Create a pipeline of middleware\n\trpc := ezrpc.\n\t\tNew().\n\t\tThen(\n\t\t\tfunc(ctx context.Context, _ *http.Request) (context.Context, error) {\n\t\t\t\tlog.Println(\"First middleware\")\n\t\t\t\treturn ctx, nil\n\t\t\t},\n\t\t\tfunc(ctx context.Context, _ *http.Request) (context.Context, error) {\n\t\t\t\tlog.Println(\"Second middleware\")\n\t\t\t\treturn ctx, nil\n\t\t\t},\n\t\t)\n\n\t// Create an HTTP mux and register the RPC hooks\n\tmux := http.NewServeMux()\n\tmux.Handle(\"/v1/sum\", rpc.Handle(ezrpc.Handle(Sum)))\n\n\t// Serve the HTTP mux\n\thttp.ListenAndServe(\"127.0.0.1:8080\", mux)\n\n}\n```\n\nDefine request and response types, and a handler function for each RPC hook:\n\n```go\ntype sumRequest struct {\n\tNumbers []int `json:\"numbers\"`\n}\n\ntype sumResponse struct {\n\tSum int `json:\"sum\"`\n}\n\n// Sum calculates the sum of a slice of numbers\nfunc Sum(ctx context.Context, req *sumRequest) (*sumResponse, error) {\n\tvar sum int\n\tfor _, number := range req.Numbers {\n\t\tsum += number\n\t}\n\treturn \u0026sumResponse{Sum: sum}, nil\n}\n```\n\n## Contributions\n\nContributions are welcome and encouraged. Please feel free to submit PRs!\n\nSome features that would be useful but don't yet exist:\n\n- Middleware\n- Optional support for non-JSON encodings (XML, YAML, etc.)\n- Storing more metadata in `context` value\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnerdouglass%2Fezrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnerdouglass%2Fezrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnerdouglass%2Fezrpc/lists"}