{"id":37178529,"url":"https://github.com/hoenirvili/rester","last_synced_at":"2026-01-14T20:48:27.360Z","repository":{"id":57483513,"uuid":"192412907","full_name":"hoenirvili/rester","owner":"hoenirvili","description":"An opinionated library for building REST APIs in Go","archived":false,"fork":false,"pushed_at":"2020-07-12T20:34:56.000Z","size":178,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T12:49:15.010Z","etag":null,"topics":["api","library","rest","rest-api","rest-library"],"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/hoenirvili.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":"2019-06-17T20:19:27.000Z","updated_at":"2020-12-14T20:06:01.000Z","dependencies_parsed_at":"2022-08-28T17:40:44.211Z","dependency_job_id":null,"html_url":"https://github.com/hoenirvili/rester","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hoenirvili/rester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenirvili%2Frester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenirvili%2Frester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenirvili%2Frester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenirvili%2Frester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoenirvili","download_url":"https://codeload.github.com/hoenirvili/rester/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenirvili%2Frester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","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":["api","library","rest","rest-api","rest-library"],"created_at":"2026-01-14T20:48:26.567Z","updated_at":"2026-01-14T20:48:27.347Z","avatar_url":"https://github.com/hoenirvili.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rester\n[![Build Status](https://travis-ci.com/hoenirvili/rester.svg?branch=master)](https://travis-ci.com/hoenirvili/rester) [![GoDoc](https://godoc.org/github.com/hoenirvili/rester?status.svg)](https://godoc.org/github.com/hoenirvili/rester) [![Go Report Card](https://goreportcard.com/badge/github.com/hoenirvili/rester)](https://goreportcard.com/report/github.com/hoenirvili/rester) [![Coverage Status](https://coveralls.io/repos/github/hoenirvili/rester/badge.svg?branch=master)](https://coveralls.io/github/hoenirvili/rester?branch=master) ![GitHub](https://img.shields.io/github/license/hoenirvili/rester.svg)\n\nAn Opinionated library for building REST APIs in Go.\n\n\n## Simple rest resource with one method without checking the permissions\n\n```go\n\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/hoenirvili/rester\"\n\t\"github.com/hoenirvili/rester/request\"\n\t\"github.com/hoenirvili/rester/resource\"\n\t\"github.com/hoenirvili/rester/response\"\n\t\"github.com/hoenirvili/rester/route\"\n)\n\ntype jsonResponse struct {\n\tMessage string `json:\"message\"`\n}\n\ntype root struct{}\n\nfunc (r *root) index(req request.Request) resource.Response {\n\treturn response.Payload(\u0026jsonResponse{\"Hello World !\"})\n}\n\nfunc (r *root) Routes() route.Routes {\n\treturn route.Routes{{\n\t\tURL:     \"/\",\n\t\tMethod:  resource.Get,\n\t\tHandler: r.index,\n\t}}\n}\n\nfunc main() {\n\trester := rester.New()\n\trester.Resource(\"/\", new(root))\n\trester.Build()\n\tif err := http.ListenAndServe(\":8080\", rester); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n```\n\n\n## Using the query api to query url parameters\n\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/hoenirvili/rester\"\n\t\"github.com/hoenirvili/rester/query\"\n\t\"github.com/hoenirvili/rester/request\"\n\t\"github.com/hoenirvili/rester/resource\"\n\t\"github.com/hoenirvili/rester/response\"\n\t\"github.com/hoenirvili/rester/route\"\n\t\"github.com/hoenirvili/rester/value\"\n)\n\ntype root struct {\n}\n\ntype message struct {\n\tStr string `json:\"message\"`\n}\n\nfunc (r root) index(req request.Request) resource.Response {\n\tif err := req.Query(\"page\").Error(); err != nil {\n\t\treturn response.BadRequest(\"invalid page param\")\n\t}\n\n\tpage := req.Query(\"page\").Int()\n\tstr := fmt.Sprintf(\"get request with query param page=%d\", page)\n\treturn response.Payload(\u0026message{str})\n}\n\nfunc (r root) Routes() route.Routes {\n\treturn route.Routes{{\n\t\tURL:     \"/\",\n\t\tMethod:  http.MethodGet,\n\t\tHandler: r.index,\n\t\tQueryPairs: query.Pairs{\n\t\t\t\"page\": query.Value{Type: value.Int},\n\t\t},\n\t}}\n}\nfunc main() {\n\trester := rester.New()\n\trester.Resource(\"/\", new(root))\n\trester.Build()\n\tif err := http.ListenAndServe(\":8080\", rester); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n### For more examples how to use the API, please visit the [examples](https://github.com/hoenirvili/rester/tree/master/examples) folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoenirvili%2Frester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoenirvili%2Frester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoenirvili%2Frester/lists"}