{"id":49570053,"url":"https://github.com/fox-toolkit/timeout","last_synced_at":"2026-05-25T02:02:09.238Z","repository":{"id":189022938,"uuid":"679373224","full_name":"fox-toolkit/timeout","owner":"fox-toolkit","description":"Timeout middleware for Fox","archived":false,"fork":false,"pushed_at":"2026-05-03T11:49:41.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-03T13:23:59.707Z","etag":null,"topics":["fox","go","golang","middleware","timeout"],"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/fox-toolkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-16T17:34:45.000Z","updated_at":"2026-05-03T11:49:17.000Z","dependencies_parsed_at":"2024-12-01T15:28:41.130Z","dependency_job_id":"c0d6c898-257f-4dbd-b0a5-7ed6964fd3db","html_url":"https://github.com/fox-toolkit/timeout","commit_stats":null,"previous_names":["tigerwill90/foxtimeout","fox-toolkit/timeout"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/fox-toolkit/timeout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-toolkit%2Ftimeout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-toolkit%2Ftimeout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-toolkit%2Ftimeout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-toolkit%2Ftimeout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fox-toolkit","download_url":"https://codeload.github.com/fox-toolkit/timeout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-toolkit%2Ftimeout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33457339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"online","status_checked_at":"2026-05-25T02:00:05.812Z","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":["fox","go","golang","middleware","timeout"],"created_at":"2026-05-03T13:14:14.771Z","updated_at":"2026-05-25T02:02:09.197Z","avatar_url":"https://github.com/fox-toolkit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/fox-toolkit/timeout.svg)](https://pkg.go.dev/github.com/fox-toolkit/timeout)\n[![tests](https://github.com/fox-toolkit/timeout/actions/workflows/tests.yaml/badge.svg)](https://github.com/fox-toolkit/timeout/actions?query=workflow%3Atests)\n[![Go Report Card](https://goreportcard.com/badge/github.com/fox-toolkit/timeout)](https://goreportcard.com/report/github.com/fox-toolkit/timeout)\n[![codecov](https://codecov.io/gh/fox-toolkit/timeout/graph/badge.svg?token=TglbhaKMOx)](https://codecov.io/gh/fox-toolkit/timeout)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fox-toolkit/timeout)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/fox-toolkit/timeout)\n\n# Timeout\n\n\u003e [!NOTE]\n\u003e This repository has been transferred from `github.com/tigerwill90/foxtimeout` to `github.com/fox-toolkit/timeout`.\n\u003e Existing users should update their imports and `go.mod` accordingly.\n\nTimeout is a middleware for [Fox](https://github.com/fox-toolkit/fox) which ensure that a handler do not exceed the\nconfigured timeout limit.\n\n## Disclaimer\nTimeout's API is closely tied to the Fox router, and it will only reach v1 when the router is stabilized.\nDuring the pre-v1 phase, breaking changes may occur and will be documented in the release notes.\n\n## Getting started\n### Installation\n\n````shell\ngo get -u github.com/fox-toolkit/timeout\n````\n### Feature\n- Allows for custom timeout response to better suit specific use cases.\n- Tightly integrates with the Fox ecosystem for enhanced performance and scalability.\n- Supports dynamic timeout configuration on a per-route \u0026 per-request basis using custom `Resolver`.\n\n### Usage\n````go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/fox-toolkit/fox\"\n\t\"github.com/fox-toolkit/timeout\"\n)\n\nfunc main() {\n\tf := fox.MustRouter(\n\t\tfox.DefaultOptions(),\n\t\tfox.WithMiddleware(\n\t\t\ttimeout.Middleware(2*time.Second),\n\t\t),\n\t)\n\n\tf.MustAdd(fox.MethodGet, \"/hello/{name}\", func(c *fox.Context) {\n\t\t_ = c.String(http.StatusOK, fmt.Sprintf(\"Hello %s\\n\", c.Param(\"name\")))\n\t})\n\t// Disable timeout the middleware for this route\n\tf.MustAdd(fox.MethodGet, \"/download/+{filepath}\", DownloadHandler, timeout.OverrideHandler(timeout.NoTimeout))\n\t// Use 15s timeout instead of the global 2s for this route\n\tf.MustAdd(fox.MethodGet, \"/workflow/{id}/start\", WorkflowHandler, timeout.OverrideHandler(15*time.Second))\n\n\tif err := http.ListenAndServe(\":8080\", f); err != nil \u0026\u0026 !errors.Is(err, http.ErrServerClosed) {\n\t\tlog.Fatalln(err)\n\t}\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-toolkit%2Ftimeout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffox-toolkit%2Ftimeout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-toolkit%2Ftimeout/lists"}