{"id":18930888,"url":"https://github.com/emitter-io/go","last_synced_at":"2025-07-14T18:40:54.430Z","repository":{"id":46782047,"uuid":"73913112","full_name":"emitter-io/go","owner":"emitter-io","description":"Go/Golang client for emitter","archived":false,"fork":false,"pushed_at":"2024-10-05T21:43:03.000Z","size":4849,"stargazers_count":69,"open_issues_count":6,"forks_count":36,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-04T12:07:19.186Z","etag":null,"topics":["emitter","mqtt","networking","publish-subscribe","pubsub","sdk"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emitter-io.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["kelindar"]}},"created_at":"2016-11-16T11:21:46.000Z","updated_at":"2024-12-23T04:40:07.000Z","dependencies_parsed_at":"2024-06-18T14:01:57.066Z","dependency_job_id":"14a33690-eec3-4c53-8a75-f34f0486f059","html_url":"https://github.com/emitter-io/go","commit_stats":{"total_commits":56,"total_committers":11,"mean_commits":5.090909090909091,"dds":0.625,"last_synced_commit":"5df9a117322800e6ec1bdf485d58645921c9ba2e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/emitter-io/go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emitter-io","download_url":"https://codeload.github.com/emitter-io/go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emitter-io%2Fgo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265334097,"owners_count":23748949,"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","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":["emitter","mqtt","networking","publish-subscribe","pubsub","sdk"],"created_at":"2024-11-08T11:39:23.826Z","updated_at":"2025-07-14T18:40:54.383Z","avatar_url":"https://github.com/emitter-io.png","language":"Go","funding_links":["https://github.com/sponsors/kelindar"],"categories":[],"sub_categories":[],"readme":"# Emitter Golang SDK [![api documentation](http://b.repl.ca/v1/api-documentation-green.png)](https://godoc.org/github.com/emitter-io/go)\nThis repository contains Go/Golang client for [Emitter](https://emitter.io) (see also on [Emitter GitHub](https://github.com/emitter-io/emitter)). Emitter is an **open-source** real-time communication service for connecting online devices. At its core, emitter.io is a distributed, scalable and fault-tolerant publish-subscribe messaging platform based on MQTT protocol and featuring message storage.\n\nThis library provides a nicer MQTT interface fine-tuned and extended with specific features provided by [Emitter](https://emitter.io). The code uses the [Eclipse Paho MQTT Go Client](https://github.com/eclipse/paho.mqtt.golang) for handling all the network communication and MQTT protocol, and is released under the same license (EPL v1). \n\n## Usage\n\nThis library aims to be as simple and straighforward as possible. First thing you'll need to do is to import it.\n\n```go\nimport emitter \"github.com/emitter-io/go/v2\"\n```\n\nThen, you can use the functions exposed by `Emitter` type - they are simple methods such as `Connect`, `Publish`, `Subscribe`, `Unsubscribe`, `GenerateKey`, `Presence`, etc. See the example below.\n\n```go\nfunc main() {\n\n\n\t// Create the client and connect to the broker\n\tc, _ := emitter.Connect(\"\", func(_ *emitter.Client, msg emitter.Message) {\n\t\tfmt.Printf(\"[emitter] -\u003e [B] received: '%s' topic: '%s'\\n\", msg.Payload(), msg.Topic())\n\t})\n\n\t// Set the presence handler\n\tc.OnPresence(func(_ *emitter.Client, ev emitter.PresenceEvent) {\n\t\tfmt.Printf(\"[emitter] -\u003e [B] presence event: %d subscriber(s) at topic: '%s'\\n\", len(ev.Who), ev.Channel)\n\t})\n\n\tfmt.Println(\"[emitter] \u003c- [B] querying own name\")\n\tid := c.ID()\n\tfmt.Println(\"[emitter] -\u003e [B] my name is \" + id)\n\n\t// Subscribe to sdk-integration-test channel\n\tfmt.Println(\"[emitter] \u003c- [B] subscribing to 'sdk-integration-test/'\")\n\tc.Subscribe(key, \"sdk-integration-test/\", func(_ *emitter.Client, msg emitter.Message) {\n\t\tfmt.Printf(\"[emitter] -\u003e [B] received on specific handler: '%s' topic: '%s'\\n\", msg.Payload(), msg.Topic())\n\t})\n\n\t// Ask for presence\n\tfmt.Println(\"[emitter] \u003c- [B] asking for presence on 'sdk-integration-test/'\")\n\tc.Presence(key, \"sdk-integration-test/\", true, false)\n\n\t// Publish to the channel\n\tfmt.Println(\"[emitter] \u003c- [B] publishing to 'sdk-integration-test/'\")\n\tc.Publish(key, \"sdk-integration-test/\", \"hello\")\n\n\tselect {}  // wait forever without busy loop - Ctrl-c to stop\n}\n```\n\n## Installation and Build\n\nThis client, similarly to the Eclipse Paho client is designed to work with the standard Go tools, so installation is as easy as:\n\n```go\ngo get -u github.com/emitter-io/go/v2\n```\n\nFor usage, please refer to the `sample` sub-folder in this repository which provides a sample application on how to use the API.\n\n## API Documentation\n\nThe full API documentation of exported members is available on [godoc.org/github.com/emitter-io/go/v2](https://godoc.org/github.com/emitter-io/go/v2).\n\n## License\n\nLicensed with EPL 1.0, similarly to Eclipse Paho MQTT Client.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femitter-io%2Fgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femitter-io%2Fgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femitter-io%2Fgo/lists"}