{"id":32641479,"url":"https://github.com/themisir/gosnail","last_synced_at":"2025-10-31T02:58:45.249Z","repository":{"id":57621975,"uuid":"393785592","full_name":"themisir/gosnail","owner":"themisir","description":"Yet another go http router. But this one doesn't focuses on performance. Rather it focuses on developer experience.","archived":false,"fork":false,"pushed_at":"2021-08-07T22:19:20.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T13:45:16.317Z","etag":null,"topics":["go-router","golang","http-routing"],"latest_commit_sha":null,"homepage":"","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/themisir.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":"2021-08-07T20:27:45.000Z","updated_at":"2021-08-10T05:53:51.000Z","dependencies_parsed_at":"2022-08-27T00:00:29.302Z","dependency_job_id":null,"html_url":"https://github.com/themisir/gosnail","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/themisir/gosnail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themisir%2Fgosnail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themisir%2Fgosnail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themisir%2Fgosnail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themisir%2Fgosnail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themisir","download_url":"https://codeload.github.com/themisir/gosnail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themisir%2Fgosnail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281920155,"owners_count":26583946,"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","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go-router","golang","http-routing"],"created_at":"2025-10-31T02:57:23.439Z","updated_at":"2025-10-31T02:58:45.235Z","avatar_url":"https://github.com/themisir.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐌 GoSnail\n\nExperimental express.js like HTTP router written in golang. This project was\njust a demostration to check whether or not we could create \"developer friendly\"\nAPI for http routing.\n\n## What does it look like?\n\nTake a look at this sample code..\n\n```go\nimport (\n  \"fmt\"\n\n  \"gosnail\"\n)\n\nfunc main() {\n  // Router handles incoming requests from Application or another routers\n  router := gosnail.NewRouter()\n\n  // Application is wrapper for http.Handler that composes and redirects\n  // requests to router\n  app := gosnail.NewApplication(router)\n\n  // Simple GET / request handler\n  //\n  // Arguments:\n  //   ctx  - is request context contains request and response details\n  //   next - calling this function fill forward request to the next handler\n  router.Get(\"/\", func (ctx *gosnail.Context, next func()) {\n    fmt.Fprintf(ctx.Response(), \"Index page\")\n  })\n\n  // Middleware that handles all requests (excluding previously handled ones)\n  //\n  // Middlewares are simple functions that can intercept request and response\n  // data and has ability to modifying them.\n  //\n  // In this example middleware, it simply checks if the request has an header\n  // named 'Authorization', if not it simply responds with 401 status code. If\n  // there's one, it forwards request to next handler.\n  router.Use(gosnail.Any, func (ctx *gosnail.Context, next func()) {\n    if ctx.Request().Headers.Get(\"Authorization\") != \"\" {\n      ctx.Response().StatusCode = 401\n      ctx.Response().End()\n    } else {\n      next()\n    }\n  })\n\n  // Another simple GET /users handler.\n  //\n  // This handler will get called only if previously registered middleware\n  // forwards request to it.\n  router.Get(\"/users\", func (ctx *gosnail.Context, next func()) {\n    fmt.Fprintf(ctx.Response(), \"This is supposed to be user list...\")\n  })\n\n  // Creates http server that listens for incoming requests to port 8080 and\n  // forwards them to the router.\n  //\n  // This method has same effect as calling http.ListenAndServe(\":8080\", app)\n  app.Listen(\":8080\")\n}\n```\n\n## Why?\n\nBecause current state of routing libraries in golang is not much friendly for\nnewcomer developers to golang coming from much simplier environments like\nnode.js. Bla blah... To be honest, I was just bored and tried to do something\nfor fun.\n\n**It's not likely that I'm going to continue to work on this repository. So\nplease don't use it.**\n\nAlso if you read this far, I wanna let you know that I hate golang's module /\npackage management system, and that's what frustrated me a lot during making of\nthis package. That's it, thanks for coming to my TED talk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemisir%2Fgosnail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemisir%2Fgosnail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemisir%2Fgosnail/lists"}