{"id":13413225,"url":"https://github.com/vaelen/iot","last_synced_at":"2026-01-12T15:41:00.876Z","repository":{"id":54346984,"uuid":"124349883","full_name":"vaelen/iot","owner":"vaelen","description":"A Go client for Google IoT Core","archived":false,"fork":false,"pushed_at":"2019-11-08T18:32:28.000Z","size":48,"stargazers_count":68,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-23T10:30:58.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/vaelen.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":"2018-03-08T06:51:51.000Z","updated_at":"2025-10-01T04:57:56.000Z","dependencies_parsed_at":"2022-08-13T12:50:29.989Z","dependency_job_id":null,"html_url":"https://github.com/vaelen/iot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vaelen/iot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaelen%2Fiot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaelen%2Fiot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaelen%2Fiot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaelen%2Fiot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaelen","download_url":"https://codeload.github.com/vaelen/iot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaelen%2Fiot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341270,"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":[],"created_at":"2024-07-30T20:01:35.569Z","updated_at":"2026-01-12T15:41:00.858Z","avatar_url":"https://github.com/vaelen.png","language":"Go","funding_links":[],"categories":["IoT (Internet of Things)"],"sub_categories":["Advanced Console UIs"],"readme":"IoT\n===\n\nA simple framework for implementing a Google IoT device.\n\nThis package makes use of the [context package] to handle request cancelation, timeouts, and deadlines.\n\n[![gocover.io](https://gocover.io/_badge/github.com/vaelen/iot)](https://gocover.io/github.com/vaelen/iot)\n[![Go Report Card](https://goreportcard.com/badge/github.com/vaelen/iot)](https://goreportcard.com/report/github.com/vaelen/iot)\n[![Go Docs](https://godoc.org/github.com/vaelen/iot?status.svg)](https://godoc.org/github.com/vaelen/iot)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)  \n\nCopyright 2018, Andrew C. Young \u003c\u003candrew@vaelen.org\u003e\u003e\n\nLicense: [MIT]\n\nHere is an example showing how to use this library:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"github.com/vaelen/iot\"\n\t// Your client must include the paho package\n\t// to use the default Eclipse Paho MQTT client.\n\t_ \"github.com/vaelen/iot/paho\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tid := \u0026iot.ID{\n\t\tDeviceID:  \"deviceName\",\n\t\tRegistry:  \"my-registry\",\n\t\tLocation:  \"asia-east1\",\n\t\tProjectID: \"my-project\",\n\t}\n\n\tcredentials, err := iot.LoadRSACredentials(\"rsa_cert.pem\", \"rsa_private.pem\")\n\tif err != nil {\n\t\tpanic(\"Couldn't load credentials\")\n\t}\n\n\toptions := iot.DefaultOptions(id, credentials)\n\toptions.DebugLogger = log.Println\n\toptions.InfoLogger = log.Println\n\toptions.ErrorLogger = log.Println\n\toptions.ConfigHandler = func(thing iot.Thing, config []byte) {\n\t\t// Do something here to process the updated config and create an updated state string\n\t\tstate := []byte(\"ok\")\n\t\tthing.PublishState(ctx, state)\n\t}\n\n\tthing := iot.New(options)\n\n\terr = thing.Connect(ctx, \"ssl://mqtt.googleapis.com:443\")\n\tif err != nil {\n\t\tpanic(\"Couldn't connect to server\")\n\t}\n\tdefer thing.Disconnect(ctx)\n\n\t// This publishes to /events\n\tthing.PublishEvent(ctx, []byte(\"Top level telemetry event\"))\n\t// This publishes to /events/a\n\tthing.PublishEvent(ctx, []byte(\"Sub folder telemetry event\"), \"a\")\n\t// This publishes to /events/a/b\n\tthing.PublishEvent(ctx, []byte(\"Sub folder telemetry event\"), \"a\", \"b\")\n}\n```\n\nThanks to [Infostellar] for supporting my development of this project.\n\n[Andrew C. Young]: http;//vaelen.org\n[Infostellar]: http://infostellar.net\n[context package]: https://golang.org/pkg/context/\n[MIT]: ../blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaelen%2Fiot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaelen%2Fiot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaelen%2Fiot/lists"}