{"id":19806358,"url":"https://github.com/ory/graceful","last_synced_at":"2025-04-04T07:05:41.005Z","repository":{"id":44035580,"uuid":"90079380","full_name":"ory/graceful","owner":"ory","description":"A best practice http server set up that supports graceful shutdown","archived":false,"fork":false,"pushed_at":"2024-08-27T10:15:40.000Z","size":179,"stargazers_count":189,"open_issues_count":1,"forks_count":18,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T16:07:16.219Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"_ory","open_collective":"ory"}},"created_at":"2017-05-02T21:25:03.000Z","updated_at":"2024-10-20T04:14:55.000Z","dependencies_parsed_at":"2024-04-12T10:24:30.483Z","dependency_job_id":"0ae48b7c-f6bb-4da8-a686-641549d835de","html_url":"https://github.com/ory/graceful","commit_stats":{"total_commits":81,"total_committers":11,"mean_commits":7.363636363636363,"dds":0.2098765432098766,"last_synced_commit":"25dd709979ed3158ba20e0d894148fd94b5149d1"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ory%2Fgraceful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ory%2Fgraceful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ory%2Fgraceful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ory%2Fgraceful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ory","download_url":"https://codeload.github.com/ory/graceful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135138,"owners_count":20889420,"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-11-12T09:07:22.320Z","updated_at":"2025-04-04T07:05:40.984Z","avatar_url":"https://github.com/ory.png","language":"Go","funding_links":["https://patreon.com/_ory","https://opencollective.com/ory"],"categories":[],"sub_categories":[],"readme":"# graceful\n\n[![Build Status](https://travis-ci.org/ory/graceful.svg?branch=master)](https://travis-ci.org/ory/graceful)\n[![Coverage Status](https://coveralls.io/repos/github/ory/graceful/badge.svg?branch=master)](https://coveralls.io/github/ory/graceful?branch=master)\n[![Docs: GoDoc](https://img.shields.io/badge/docs-godoc-blue.svg)](https://godoc.org/github.com/ory/graceful)\n\n[![Join the chat at https://slack.ory.sh/](https://img.shields.io/badge/join-chat-00cc99.svg)](https://slack.ory.sh/)\n\nBest practice http server configurations and helpers for Go 1.8's http graceful\nshutdown feature. Currently supports best practice configurations by:\n\n- [Cloudflare](https://blog.cloudflare.com/exposing-go-on-the-internet/)\n\n## Usage\n\nTo install this library, do:\n\n```sh\ngo get github.com/ory/graceful\n```\n\n### Running Cloudflare Config with Graceful Shutdown\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \"log\"\n\n    \"github.com/ory/graceful\"\n)\n\nfunc main() {\n    server := graceful.WithDefaults(\u0026http.Server{\n        Addr: \":54932\",\n        // Handler: someHandler,\n    })\n\n    log.Println(\"main: Starting the server\")\n    if err := graceful.Graceful(server.ListenAndServe, server.Shutdown); err != nil {\n        log.Fatalln(\"main: Failed to gracefully shutdown\")\n    }\n    log.Println(\"main: Server was shutdown gracefully\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fory%2Fgraceful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fory%2Fgraceful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fory%2Fgraceful/lists"}