{"id":13414101,"url":"https://github.com/sinhashubham95/bleep","last_synced_at":"2026-01-26T06:31:31.362Z","repository":{"id":57560192,"uuid":"326114756","full_name":"sinhashubham95/bleep","owner":"sinhashubham95","description":"OS Signal Handlers in Go","archived":false,"fork":false,"pushed_at":"2021-01-06T03:41:42.000Z","size":9,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T20:53:21.952Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinhashubham95.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-02T05:22:08.000Z","updated_at":"2024-01-09T14:13:16.000Z","dependencies_parsed_at":"2022-08-26T07:01:39.114Z","dependency_job_id":null,"html_url":"https://github.com/sinhashubham95/bleep","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sinhashubham95/bleep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhashubham95%2Fbleep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhashubham95%2Fbleep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhashubham95%2Fbleep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhashubham95%2Fbleep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinhashubham95","download_url":"https://codeload.github.com/sinhashubham95/bleep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinhashubham95%2Fbleep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28768336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-30T20:01:57.673Z","updated_at":"2026-01-26T06:31:31.345Z","avatar_url":"https://github.com/sinhashubham95.png","language":"Go","funding_links":[],"categories":["Utilities","公用事业公司","Utility"],"sub_categories":["Fail injection","实用程序/Miscellaneous","Utility/Miscellaneous","HTTP Clients"],"readme":"# Bleep\n\n[![GoDoc](https://godoc.org/github.com/sinhashubham95/bleep?status.svg)](https://pkg.go.dev/github.com/sinhashubham95/bleep)\n[![Release](https://img.shields.io/github/v/release/sinhashubham95/bleep?sort=semver)](https://github.com/sinhashubham95/bleep/releases)\n[![Report](https://goreportcard.com/badge/github.com/sinhashubham95/bleep)](https://goreportcard.com/report/github.com/sinhashubham95/bleep)\n[![Coverage Status](https://coveralls.io/repos/github/sinhashubham95/bleep/badge.svg?branch=master)](https://coveralls.io/github/sinhashubham95/bleep?branch=master)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#utilities)\n\n`Bleep` is used to peform actions on OS signals. It is highly extensible and goroutine safe. It is possible to add any number of actions and all of them are guaranteed to be performed simultaneously on the OS signals that `Bleep` will be listening for.\n\n## Installation\n\n```shell\ngo get github.com/sinhashubham95/bleep\n```\n\n## How to Use\n\nThe `Bleep` package allows you to create a new instance of the handler and also has a default handler in place that can be used directly.\n\nCreating separate Bleep instances can be useful, when you want to perform different set of actions for different set of OS signals.\n\n### Create a New OS Signal Handler\n\nThis is used to create a new handler for performing actions on OS Signals.\n\n```go\nimport (\n  \"os\"\n  \"github.com/sinhashubham95/bleep\"\n)\n\nfunc New() {\n  handler := bleep.New()\n  // now this handler can be used to add or remove actions and listen to the OS signals\n}\n```\n\n### Add an Action\n\nThis is used to add an action to be executed on the OS signal listening for.\n\n```go\nimport (\n  \"os\"\n  \"github.com/sinhashubham95/bleep\"\n)\n\nfun Add() {\n  key := bleep.Add(func (s os.Signal) {\n    // do something\n  })\n  // this key is the unique identifier for your added action\n}\n```\n\n### Remove an Action\n\nThis is used to remove an action added to Bleep.\n\n```go\nimport (\n  \"github.com/sinhashubham95/bleep\"\n)\n\nfunc Remove() {\n  action := bleep.Remove(\"some-key\")  // this key should be the same as the one returned during adding the action\n  // the returned action is the one that was added using this key\n}\n```\n\n### Listen\n\nThis is used to listen for the OS signals. Note that this will wait for the signal in the go routine in which this is called.\n\n```go\nimport (\n  \"syscall\"\n  \"github.com/sinhashubham95/bleep\"\n)\n\nfunc Listen() {\n  bleep.Listen(syscall.SIGINT, syscall.SIGTERM)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhashubham95%2Fbleep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinhashubham95%2Fbleep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinhashubham95%2Fbleep/lists"}