{"id":34225493,"url":"https://github.com/plimble/jsonrpc","last_synced_at":"2026-03-13T13:33:52.884Z","repository":{"id":57495733,"uuid":"89169309","full_name":"plimble/jsonrpc","owner":"plimble","description":"jsonrpc on echo","archived":false,"fork":false,"pushed_at":"2017-04-27T15:00:40.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T03:47:11.246Z","etag":null,"topics":["golang","jsonrpc"],"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/plimble.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}},"created_at":"2017-04-23T20:09:54.000Z","updated_at":"2021-05-10T23:13:25.000Z","dependencies_parsed_at":"2022-08-28T19:51:21.586Z","dependency_job_id":null,"html_url":"https://github.com/plimble/jsonrpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/plimble/jsonrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plimble%2Fjsonrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plimble%2Fjsonrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plimble%2Fjsonrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plimble%2Fjsonrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plimble","download_url":"https://codeload.github.com/plimble/jsonrpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plimble%2Fjsonrpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30467803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"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":["golang","jsonrpc"],"created_at":"2025-12-16T00:07:45.153Z","updated_at":"2026-03-13T13:33:52.873Z","avatar_url":"https://github.com/plimble.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsonrpc\nJSONRPC on echo\n\n## Install\n\n#### Install Server\n\n```\ngo get -u github.com/plimble/jsonrpc\n```\n\n#### Install client\n\n```\ngo get -u github.com/plimble/jsonrpc/client\n```\n\n#### Install Both\n\n```\ngo get -u github.com/plimble/jsonrpc/...\n```\n\n## Example Server\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t\"github.com/labstack/echo\"\n\t\"github.com/plimble/jsonrpc\"\n)\n\ntype Adder struct{}\n\ntype AddReq struct {\n\tA, B int\n}\n\ntype AddRes struct {\n\tVal int\n}\n\nfunc (a *Adder) Add(ctx context.Context, req *AddReq) (*AddRes, error) {\n\tval := req.A + req.B\n\treturn \u0026AddRes{\n\t\tVal: val,\n\t}, nil\n}\n\nfunc (a *Adder) Multiply(ctx context.Context, req *AddReq) (*AddRes, error) {\n\tval := req.A * req.B\n\treturn \u0026AddRes{\n\t\tVal: val,\n\t}, nil\n}\n\nfunc main() {\n\tj := jsonrpc.New()\n\tj.Register(new(Adder), \"adder\")\n\te := echo.New()\n\te.POST(\"/\", j.Handle)\n\te.POST(\"/batch\", j.HandleBatch)\n\n\te.Start(\":3000\")\n}\n```\n\n## Example Client\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/plimble/jsonrpc/client\"\n)\n\nfunc main() {\n\tc := client.New(\"http://localhost:3000\", \"/\", \"/batch\")\n\tres, err := c.Request(\"adder.Add\", client.Params{\"a\": 1, \"b\": 4})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif res.Error != nil {\n\t\tpanic(res.Error)\n\t}\n\n\tresult := make(map[string]interface{})\n\tres.UnmarshalResult(\u0026result)\n\tfmt.Println(\"Result:\", result)\n\n\tress, err := c.Requests(\u0026client.Requests{\n\t\tclient.NewRequest(\"adder.Add\", client.Params{\"a\": 1, \"b\": 2}),\n\t\tclient.NewRequest(\"adder.Add\", client.Params{\"a\": 2, \"b\": 2}),\n\t\tclient.NewRequest(\"adder.Add\", client.Params{\"a\": 3, \"b\": 2}),\n\t\tclient.NewRequest(\"adder.Multiply\", client.Params{\"a\": 4, \"b\": 2}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, res := range ress {\n\t\tresult := make(map[string]interface{})\n\t\tres.UnmarshalResult(\u0026result)\n\t\tfmt.Println(\"Batch Result:\", result)\n\t}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplimble%2Fjsonrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplimble%2Fjsonrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplimble%2Fjsonrpc/lists"}