{"id":13652970,"url":"https://github.com/dougblack/sleepy","last_synced_at":"2025-04-23T06:30:58.948Z","repository":{"id":13505946,"uuid":"16196823","full_name":"dougblack/sleepy","owner":"dougblack","description":"rest for go","archived":false,"fork":false,"pushed_at":"2017-11-26T18:15:34.000Z","size":1462,"stargazers_count":675,"open_issues_count":10,"forks_count":56,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-11-10T04:36:16.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dougblack.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}},"created_at":"2014-01-24T06:20:44.000Z","updated_at":"2024-10-28T12:12:58.000Z","dependencies_parsed_at":"2022-08-28T17:12:47.402Z","dependency_job_id":null,"html_url":"https://github.com/dougblack/sleepy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougblack%2Fsleepy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougblack%2Fsleepy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougblack%2Fsleepy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougblack%2Fsleepy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougblack","download_url":"https://codeload.github.com/dougblack/sleepy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250384796,"owners_count":21421794,"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":[],"created_at":"2024-08-02T02:01:04.530Z","updated_at":"2025-04-23T06:30:58.247Z","avatar_url":"https://github.com/dougblack.png","language":"Go","funding_links":[],"categories":["`API Frameworks`","Servers","API Frameworks","Service Toolkits"],"sub_categories":["Go"],"readme":"## Sleepy\n\nI wrote about the creation of sleepy\n[here](https://dougblack.io/words/a-restful-micro-framework-in-go.html).\n\n#### A RESTful framework for Go\n\nSleepy is a micro-framework for building RESTful APIs.\n\n```go\npackage main\n\nimport (\n    \"net/url\"\n    \"net/http\"\n    \"github.com/dougblack/sleepy\"\n)\n\ntype Item struct { }\n\nfunc (item Item) Get(values url.Values, headers http.Header) (int, interface{}, http.Header) {\n    items := []string{\"item1\", \"item2\"}\n    data := map[string][]string{\"items\": items}\n    return 200, data, http.Header{\"Content-type\": {\"application/json\"}}\n}\n\nfunc main() {\n    item := new(Item)\n\n    api := sleepy.NewAPI()\n    api.AddResource(item, \"/items\")\n    api.Start(3000)\n}\n```\n\nNow if we curl that endpoint:\n\n```bash\n$ curl localhost:3000/items\n{\"items\": [\"item1\", \"item2\"]}\n```\n\n`sleepy` has not been officially released yet, as it is still in active\ndevelopment.\n\n## Docs\n\nDocumentation lives [here](http://godoc.org/github.com/dougblack/sleepy).\n\n## License\n\n`sleepy` is released under the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougblack%2Fsleepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougblack%2Fsleepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougblack%2Fsleepy/lists"}