{"id":36864017,"url":"https://github.com/geniusrabbit/notificationcenter","last_synced_at":"2026-01-12T14:52:22.343Z","repository":{"id":16701549,"uuid":"73096615","full_name":"geniusrabbit/notificationcenter","owner":"geniusrabbit","description":"🚦 notification message abstraction on top of different messaging pipelines (Kafka, NATS, RedisPubSub, etc)","archived":false,"fork":false,"pushed_at":"2025-09-20T10:27:22.000Z","size":241,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T12:13:48.513Z","etag":null,"topics":["go","golang","kafka","nats","postgres-notifications","queues","redis-queue","streams"],"latest_commit_sha":null,"homepage":"","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/geniusrabbit.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,"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":"2016-11-07T16:09:55.000Z","updated_at":"2025-09-20T10:07:44.000Z","dependencies_parsed_at":"2024-04-17T12:46:20.430Z","dependency_job_id":"43b26fe6-42e2-4574-b44d-5f0efe8162ed","html_url":"https://github.com/geniusrabbit/notificationcenter","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/geniusrabbit/notificationcenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geniusrabbit%2Fnotificationcenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geniusrabbit%2Fnotificationcenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geniusrabbit%2Fnotificationcenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geniusrabbit%2Fnotificationcenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geniusrabbit","download_url":"https://codeload.github.com/geniusrabbit/notificationcenter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geniusrabbit%2Fnotificationcenter/sbom","scorecard":{"id":422538,"data":{"date":"2025-08-11","repo":{"name":"github.com/geniusrabbit/notificationcenter","commit":"6a7e514200195204f21942dd51b1c24eb93ba65b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/commitlint.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/commitlint.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/commitlint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/commitlint.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/commitlint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/geniusrabbit/notificationcenter/test.yml/master?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T01:34:42.054Z","repository_id":16701549,"created_at":"2025-08-19T01:34:42.054Z","updated_at":"2025-08-19T01:34:42.054Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["go","golang","kafka","nats","postgres-notifications","queues","redis-queue","streams"],"created_at":"2026-01-12T14:52:21.650Z","updated_at":"2026-01-12T14:52:22.333Z","avatar_url":"https://github.com/geniusrabbit.png","language":"Go","readme":"# Notificationcenter Pub/Sub Library\n\n[![Build Status](https://github.com/geniusrabbit/notificationcenter/workflows/Tests/badge.svg)](https://github.com/geniusrabbit/notificationcenter/actions?workflow=Tests)\n[![Go Report Card](https://goreportcard.com/badge/github.com/geniusrabbit/notificationcenter)](https://goreportcard.com/report/github.com/geniusrabbit/notificationcenter)\n[![GoDoc](https://godoc.org/github.com/geniusrabbit/notificationcenter?status.svg)](https://godoc.org/github.com/geniusrabbit/notificationcenter)\n[![Coverage Status](https://coveralls.io/repos/github/geniusrabbit/notificationcenter/badge.svg)](https://coveralls.io/github/geniusrabbit/notificationcenter)\n\n\u003e License: Apache 2.0\n\nThe **NotificationCenter** library provides a unified interface for publish/subscribe (pub/sub) messaging in Go applications. It simplifies asynchronous communication between services in serverless and microservices architectures by abstracting the complexities of various message brokers.\n\nWith NotificationCenter, you can seamlessly integrate different pub/sub backends like Kafka, NATS, Redis, PostgreSQL, and more without altering your application logic. This promotes decoupled architectures, enhancing performance, reliability, and scalability.\n\n## Table of Contents\n\n- [Features](#features)\n- [Supported Modules](#supported-modules)\n- [Installation](#installation)\n- [Usage Examples](#usage-examples)\n  - [Import the Package](#import-the-package)\n  - [Create a Publisher](#create-a-publisher)\n  - [Publish Messages](#publish-messages)\n  - [Subscribe to Messages](#subscribe-to-messages)\n- [TODO](#todo)\n- [License](#license)\n\n## Features\n\n- **Unified Interface**: Interact with multiple pub/sub backends using a consistent API.\n- **Easy Integration**: Quickly set up publishers and subscribers with minimal configuration.\n- **Backend Flexibility**: Swap out message brokers without changing your application code.\n- **Event-Driven Architecture**: Facilitate loosely coupled communication between services.\n- **Scalability**: Improve performance and reliability by decoupling application components.\n\n## Supported Modules\n\n- [Kafka](kafka)\n- [NATS](nats)\n- [NATS Streaming](natsstream)\n- [PostgreSQL](pg)\n- [Redis](redis)\n- [Go Channels](gochan)\n- [Time Interval Executor](interval)\n\n## Installation\n\nInstall the library using `go get`:\n\n```bash\ngo get github.com/geniusrabbit/notificationcenter/v2\n```\n\n## Usage Examples\n\nBelow are basic examples demonstrating how to use NotificationCenter in your Go application.\n\n### Import the Package\n\n```go\nimport (\n  nc \"github.com/geniusrabbit/notificationcenter/v2\"\n)\n```\n\n### Create a Publisher\n\nCreate a new publisher using one of the supported backends. For example, using **NATS**:\n\n```go\nimport (\n  \"github.com/geniusrabbit/notificationcenter/v2/nats\"\n  \"log\"\n)\n\n// Create a new NATS publisher\neventStream, err := nats.NewPublisher(\n  nats.WithNatsURL(\"nats://hostname:4222\"),\n)\nif err != nil {\n  log.Fatal(err)\n}\n\n// Register the publisher with NotificationCenter\nerr = nc.Register(\"events\", eventStream)\nif err != nil {\n  log.Fatal(err)\n}\n```\n\n### Publish Messages\n\nYou can publish messages using global functions or by obtaining a publisher interface.\n\n**Using Global Functions:**\n\n```go\nimport (\n  \"context\"\n)\n\n// Define your message structure\ntype Message struct {\n  Title string\n}\n\n// Publish a message globally\nnc.Publish(context.Background(), \"events\", Message{Title: \"Event 1\"})\n```\n\n**Using Publisher Interface:**\n\n```go\n// Get the publisher interface\neventsPublisher := nc.Publisher(\"events\")\n\n// Publish a message\neventsPublisher.Publish(context.Background(), Message{Title: \"Event 2\"})\n```\n\n### Subscribe to Messages\n\nCreate a subscriber and register it with NotificationCenter.\n\n```go\nimport (\n  \"context\"\n  \"fmt\"\n  \"github.com/geniusrabbit/notificationcenter/v2\"\n  \"github.com/geniusrabbit/notificationcenter/v2/nats\"\n  \"github.com/geniusrabbit/notificationcenter/v2/interval\"\n  \"time\"\n)\n\nfunc main() {\n  ctx := context.Background()\n\n  // Create a NATS subscriber\n  eventsSubscriber := nats.MustNewSubscriber(\n    nats.WithTopics(\"events\"),\n    nats.WithNatsURL(\"nats://hostname:4222\"),\n    nats.WithGroupName(\"group\"),\n  )\n  nc.Register(\"events\", eventsSubscriber)\n\n  // Optional: Create a time interval subscriber (e.g., for periodic tasks)\n  refreshSubscriber := interval.NewSubscriber(5 * time.Minute)\n  nc.Register(\"refresh\", refreshSubscriber)\n\n  // Subscribe to the \"events\" stream\n  nc.Subscribe(\"events\", func(msg nc.Message) error {\n    // Process the received message\n    fmt.Printf(\"Received message: %v\\n\", msg.Data())\n\n    // Acknowledge the message if necessary\n    return msg.Ack()\n  })\n\n  // Subscribe to the \"refresh\" stream for periodic tasks\n  nc.Subscribe(\"refresh\", func(msg nc.Message) error {\n    // Perform your periodic task here\n    fmt.Println(\"Performing periodic refresh\")\n    return msg.Ack()\n  })\n\n  // Start listening for messages\n  nc.Listen(ctx)\n}\n```\n\n## TODO\n\n- [ ] Add support for **Amazon SQS**\n- [x] Add support for **Redis** queue\n- [ ] Add support for **RabbitMQ**\n- [ ] Add support for **MySQL notifications**\n- [x] Add support for **PostgreSQL notifications**\n- [x] ~~Remove deprecated metrics from the queue~~\n- [x] Add support for **NATS \u0026 NATS Streaming**\n- [x] Add support for **Kafka** queue\n- [x] Add support for native **Go channels**\n- [x] Add support for **Time Interval Execution**\n\n## License\n\nNotificationCenter is licensed under the [Apache 2.0 License](LICENSE).\n\n---\n\nBy using NotificationCenter, you can focus on building the core functionality of your application without worrying about the intricacies of different messaging infrastructures. Feel free to contribute to the project or report any issues you encounter.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeniusrabbit%2Fnotificationcenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeniusrabbit%2Fnotificationcenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeniusrabbit%2Fnotificationcenter/lists"}