{"id":36531848,"url":"https://github.com/obalunenko/notifier","last_synced_at":"2026-01-12T03:02:01.227Z","repository":{"id":161747928,"uuid":"636387921","full_name":"obalunenko/notifier","owner":"obalunenko","description":"Notifier package allows to send notifications to different sources (telegram, slack, logs)","archived":false,"fork":false,"pushed_at":"2025-11-12T09:57:24.000Z","size":448,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T11:31:35.769Z","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/obalunenko.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":".github/CODEOWNERS","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-05-04T18:30:46.000Z","updated_at":"2025-11-12T09:57:27.000Z","dependencies_parsed_at":"2023-12-07T10:29:43.062Z","dependency_job_id":"115ebb25-0d51-42e2-924c-1210ffda3d70","html_url":"https://github.com/obalunenko/notifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/obalunenko/notifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obalunenko%2Fnotifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obalunenko%2Fnotifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obalunenko%2Fnotifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obalunenko%2Fnotifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obalunenko","download_url":"https://codeload.github.com/obalunenko/notifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obalunenko%2Fnotifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":[],"created_at":"2026-01-12T03:02:01.161Z","updated_at":"2026-01-12T03:02:01.220Z","avatar_url":"https://github.com/obalunenko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/obalunenko/notifier)\n[![GoDoc](https://godoc.org/github.com/obalunenko/notifier?status.svg)](https://godoc.org/github.com/obalunenko/notifier)\n[![Latest release artifacts](https://img.shields.io/github/v/release/obalunenko/notifier)](https://github.com/obalunenko/notifier/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/obalunenko/notifier)](https://goreportcard.com/report/github.com/obalunenko/notifier)\n[![Go [lint, test]](https://github.com/obalunenko/notifier/actions/workflows/go.yml/badge.svg)](https://github.com/obalunenko/notifier/actions/workflows/go.yml)\n[![CodeQL](https://github.com/obalunenko/notifier/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/obalunenko/notifier/actions/workflows/codeql-analysis.yml)\n![coverbadger-tag-do-not-edit](https://img.shields.io/badge/coverage-65.42%25-brightgreen?longCache=true\u0026style=flat)\n\n# notifier\n\nPackage notifier provides functionality to send notifications.\n\n## Examples\n\n### Notifier\n\nExampleNotifier shows how to create a new notifier with a list of notifiers and send a message.\n\n```golang\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/obalunenko/notifier\"\n)\n\nconst (\n\t// Test telegram credentials.\n\ttestTGTokenEnv  = \"TEST_TELEGRAM_TOKEN\"\n\ttestTGChatIDEnv = \"TEST_TELEGRAM_CHAT_ID\"\n)\n\n// ExampleNotifier shows how to create a new notifier with a list of notifiers and send a message.\nfunc main() {\n\tctx := context.Background()\n\n\tvar buf bytes.Buffer\n\n\t// Declare list of notifiers.\n\tvar notifiers []notifier.Notifier\n\n\t// Create a new io.Writer notifier to visualize alerts.\n\twn, err := notifier.NewIOWriterNotifier(\u0026buf)\n\tif err != nil {\n\t\t// Handle error in your way.\n\t\tpanic(err)\n\t}\n\n\tnotifiers = append(notifiers, wn)\n\n\t// Create a new telegram notifier if token and chatID env set.\n\tif token, chatID := os.Getenv(testTGTokenEnv), os.Getenv(testTGChatIDEnv); token != \"\" \u0026\u0026 chatID != \"\" {\n\t\ttgn, err := notifier.NewTelegram(token, chatID)\n\t\tif err != nil {\n\t\t\t// Handle error in your way.\n\t\t\tpanic(err)\n\t\t}\n\n\t\tnotifiers = append(notifiers, tgn)\n\t}\n\n\t// Add the notifier to the list of notifiers.\n\tn, err := notifier.NewMultiNotifier(notifiers...)\n\tif err != nil {\n\t\t// Handle error in your way.\n\t\tpanic(err)\n\t}\n\n\t// Add notifier metadata to context.\n\tctx = notifier.ContextWithMetadata(ctx, notifier.Metadata{\n\t\tAppName:      \"test_app\",\n\t\tInstanceName: \"test_instance\",\n\t\tCommit:       \"test_commit\",\n\t\tBuildDate:    time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC).Format(time.DateTime),\n\t})\n\n\t// Send alert.\n\terr = n.Alert(ctx, notifier.SeverityWarning, \"[NOTIFIER_TEST]: example message\")\n\tif err != nil {\n\t\t// Handle error in your way.\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(buf.String())\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobalunenko%2Fnotifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobalunenko%2Fnotifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobalunenko%2Fnotifier/lists"}