{"id":11385694,"name":"github.com/go-pkgz/ctrl","ecosystem":"go","description":"Package ctrl provides a set of control functions for assertions, error handling, HTTP server management,\nand graceful shutdown handling in Go applications. Built for Go 1.21+, it offers a clean API with flexible\nconfiguration options and no external runtime dependencies.\n\nThe package provides assertion functions that panic when conditions are not met, useful for runtime\ninvariant checking:\n\nFor scenarios where returning an error is more appropriate than panicking, the package provides\nErrorOr variants:\n\nThe package helps manage HTTP server lifecycle, particularly graceful shutdown:\n\nThe package provides robust handling of process termination signals:\n\nUse assertions for internal invariants that should never fail in correct code:\n\nUse ErrorOr variants for validating external input or recoverable conditions:\n\nFor HTTP servers, combine graceful shutdown with server lifecycle management:\n\nExample_gracefulShutdown demonstrates basic usage of the GracefulShutdown function.\n\n\nExample_gracefulShutdownCustomConfiguration demonstrates custom shutdown configuration.\n\n\nExample_gracefulShutdownWithCallbacks demonstrates using callbacks during shutdown.\n\n\nExample_httpServerWithContext demonstrates how to run an HTTP server that shuts down\ngracefully when the parent context is canceled.","homepage":"https://github.com/go-pkgz/ctrl","licenses":"MIT","normalized_licenses":["MIT"],"repository_url":"https://github.com/go-pkgz/ctrl","keywords_array":[],"namespace":"github.com/go-pkgz","versions_count":2,"first_release_published_at":"2025-02-25T08:01:49.000Z","latest_release_published_at":"2025-08-11T03:38:05.000Z","latest_release_number":"v0.2.0","last_synced_at":"2026-05-25T19:17:55.181Z","created_at":"2025-02-27T08:10:50.646Z","updated_at":"2026-05-25T19:17:55.181Z","registry_url":"https://pkg.go.dev/github.com/go-pkgz/ctrl","install_command":"go get github.com/go-pkgz/ctrl","documentation_url":"https://pkg.go.dev/github.com/go-pkgz/ctrl#section-documentation","metadata":{},"repo_metadata":{"id":279356789,"uuid":"938519572","full_name":"go-pkgz/ctrl","owner":"go-pkgz","description":"Control primitives","archived":false,"fork":false,"pushed_at":"2025-08-11T03:41:10.000Z","size":26,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T05:30:06.700Z","etag":null,"topics":["asssertions","control-flow","golang","shutdown"],"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/go-pkgz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["umputun"]}},"created_at":"2025-02-25T04:48:40.000Z","updated_at":"2025-08-11T03:39:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"839cbe83-e6d6-4004-ae3a-9198db57d0d8","html_url":"https://github.com/go-pkgz/ctrl","commit_stats":null,"previous_names":["go-pkgz/ctrl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/go-pkgz/ctrl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-pkgz","download_url":"https://codeload.github.com/go-pkgz/ctrl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269843868,"owners_count":24484128,"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-08-11T02:00:10.019Z","response_time":75,"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"},"owner_record":{"login":"go-pkgz","name":"go packages","uuid":"38164941","kind":"organization","description":"go packages","email":"umputun@gmail.com","website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/38164941?v=4","repositories_count":14,"last_synced_at":"2023-03-02T11:35:26.258Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/go-pkgz","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-13T04:00:51.282Z","updated_at":"2023-03-02T11:35:26.495Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-pkgz","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-pkgz/repositories"},"tags":[{"name":"v0.2.0","sha":"3080a9e634fa72b7f86c70044aafaaaffc01cb9e","kind":"tag","published_at":"2025-08-11T03:41:03.000Z","download_url":"https://codeload.github.com/go-pkgz/ctrl/tar.gz/v0.2.0","html_url":"https://github.com/go-pkgz/ctrl/releases/tag/v0.2.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/go-pkgz/ctrl@v0.2.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/tags/v0.2.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/tags/v0.2.0/manifests"},{"name":"v0.1.0","sha":"ff4ef0e5b4f6896553697f2b4c58536e059bd9e4","kind":"commit","published_at":"2025-02-25T08:01:49.000Z","download_url":"https://codeload.github.com/go-pkgz/ctrl/tar.gz/v0.1.0","html_url":"https://github.com/go-pkgz/ctrl/releases/tag/v0.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/go-pkgz/ctrl@v0.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/tags/v0.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-pkgz%2Fctrl/tags/v0.1.0/manifests"}]},"repo_metadata_updated_at":"2025-11-15T03:55:30.862Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":6.09274594572081,"dependent_packages_count":5.71052111692275,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":5.90163353132178},"purl":"pkg:golang/github.com/go-pkgz/ctrl","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/go-pkgz/ctrl","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/go-pkgz/ctrl","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/go-pkgz/ctrl/dependencies","status":null,"funding_links":["https://github.com/sponsors/umputun"],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fgo-pkgz%2Fctrl/codemeta","maintainers":[]}