{"id":16170286,"url":"https://github.com/magnuschase03/pubsubgo","last_synced_at":"2026-07-18T23:07:40.735Z","repository":{"id":251619346,"uuid":"836899840","full_name":"MagnusChase03/PubSubGo","owner":"MagnusChase03","description":"This is a simple pub/sub service written in Go.","archived":false,"fork":false,"pushed_at":"2024-08-04T12:52:42.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T17:54:21.387Z","etag":null,"topics":["go","pubsub"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MagnusChase03.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}},"created_at":"2024-08-01T19:42:56.000Z","updated_at":"2024-08-04T12:53:53.000Z","dependencies_parsed_at":"2024-08-04T15:48:43.270Z","dependency_job_id":"2c0ff548-4906-478f-859d-d25cd45c759b","html_url":"https://github.com/MagnusChase03/PubSubGo","commit_stats":null,"previous_names":["magnuschase03/pubsubgo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MagnusChase03/PubSubGo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusChase03%2FPubSubGo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusChase03%2FPubSubGo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusChase03%2FPubSubGo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusChase03%2FPubSubGo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MagnusChase03","download_url":"https://codeload.github.com/MagnusChase03/PubSubGo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusChase03%2FPubSubGo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35634001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"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":["go","pubsub"],"created_at":"2024-10-10T03:18:08.359Z","updated_at":"2026-07-18T23:07:40.668Z","avatar_url":"https://github.com/MagnusChase03.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PubSubGo\n\n**This is a simple pub/sub service written in Go.**\n\n## Usage\n\nTo run the example utilization:\n\n```\n$ go run main.go\n```\n\n## API\n\nTo utilize as a library, here is the documentation:\n\n**Structs**\n\n- Publisher\n    - NewPublisher\n    - Subscribe\n    - Unsubscribe\n    - Publish\n- Subsciber\n    - NewSubscriber\n    - AddTopic\n    - RemoveTopic\n    - Signal\n    - Listen\n\n### Publisher\n\nA publisher is responsible for sending messages to those subscribed to topics.\n\n```go\ntype Publisher struct {\n    Id int\n    Subscribers map[int]*Subscriber\n    Topics map[string]map[int]*Subscriber \n    Mutex sync.RWMutex\n}\n```\n\n### NewPublisher(id int) *Publisher\n\nReturns a new publisher with given ID.\n\n### Subscribe(s *Subscriber, topic string)\n\nSubscribes the subscriber to recieve messages from given topic.\n\n### Unsubscribe(s *Subscriber, topic string)\n\nUnsubscribes the subscriber from a given topic.\n\n### Publish(topic string, message string)\n\nSends out a given message to all subscribers in a given topic.\n\n### Subscriber\n\nA subscriber is responsible for handling incoming messages from subscribed topics.\n\n```go\ntype Subscriber struct {\n    Id int\n    Messages chan *Message\n    Topics map[string]bool\n    Active bool\n    Mutex sync.RWMutex\n}\n```\n\n### NewSubscriber(id int) *Subscriber\n\nReturns a new subscriber with given ID.\n\n### AddTopic(topic string)\n\nMarks a topic as being subscriber to.\n\n### RemoveTopic(topic string)\n\nMarks a topic as not subscribed to.\n\n### Signal(message *Message)\n\nAdds a new message to the queue of messages to be processed.\n\n### Listen()\n\nContinously processes new messages in the queue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnuschase03%2Fpubsubgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnuschase03%2Fpubsubgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnuschase03%2Fpubsubgo/lists"}