{"id":37148074,"url":"https://github.com/tannerryan/ecpush","last_synced_at":"2026-01-14T17:28:46.589Z","repository":{"id":65331358,"uuid":"141851108","full_name":"tannerryan/ecpush","owner":"tannerryan","description":"A Go library for subscribing to real-time meteorological data feeds from Environment Canada.","archived":false,"fork":false,"pushed_at":"2023-01-16T17:35:37.000Z","size":105,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T20:08:12.913Z","etag":null,"topics":["amqp","go","golang","weather"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tannerryan.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-07-21T22:59:00.000Z","updated_at":"2023-01-16T17:36:24.000Z","dependencies_parsed_at":"2023-02-10T05:16:19.602Z","dependency_job_id":null,"html_url":"https://github.com/tannerryan/ecpush","commit_stats":null,"previous_names":["thetannerryan/ecpush"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tannerryan/ecpush","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerryan%2Fecpush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerryan%2Fecpush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerryan%2Fecpush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerryan%2Fecpush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tannerryan","download_url":"https://codeload.github.com/tannerryan/ecpush/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tannerryan%2Fecpush/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["amqp","go","golang","weather"],"created_at":"2026-01-14T17:28:45.955Z","updated_at":"2026-01-14T17:28:46.582Z","avatar_url":"https://github.com/tannerryan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecpush\n[![Build\nStatus](https://img.shields.io/travis/tannerryan/ecpush.svg?style=flat-square)](https://travis-ci.org/tannerryan/ecpush)\n[![Go Report\nCard](https://goreportcard.com/badge/github.com/tannerryan/ecpush?style=flat-square)](https://goreportcard.com/report/github.com/tannerryan/ecpush)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-5673AF.svg?style=flat-square)](https://pkg.go.dev/github.com/tannerryan/ecpush)\n[![GitHub\nlicense](https://img.shields.io/github/license/tannerryan/ecpush.svg?style=flat-square)](https://github.com/tannerryan/ecpush/blob/master/LICENSE)\n\necpush is a Go package for subscribing to real-time meteorological data feeds\nfrom Environment Canada.\n\n\n## Documentation\nPlease visit the corresponding\n[**GoDoc**](https://pkg.go.dev/github.com/tannerryan/ecpush) entry for all\nnecessary documentation, including parameter definitions and program defaults.\n\n\n## Goals\nThe main goal of ecpush is to provide a simple and lightweight client that can\nbe used for receiving real-time data events directly from Environment Canada's\nmeteorological product feed.\n\nThe client can directly fetch the published products, or it can just provide a\nnotification channel containing the product location (HTTP URL to Environment\nCanada's Datamart). The client has also been designed to automatically recover\nfrom any connection or channel interruptions.\n\n\n## Usage\nTo create a new client, create a `Client` struct. The only required field is the\n`Subtopics` array. Default values for other fields are listed in the struct\ndefinition. An example configuration is shown below (subscribing text bulletins,\ncitypage XML and CAP alert files).\n\nPlease see [subtopic amqp\npattern](https://github.com/MetPX/sarracenia/blob/master/doc/sr_subscribe.1.rst#subtopic-amqp-pattern-subtopic-need-to-be-set)\nfor formatting subtopics.\n```go\nclient := \u0026ecpush.Client{\n    Subtopics: \u0026[]string{\n        \"alerts.cap.#\",\n        \"bulletins.alphanumeric.#\",\n        \"citypage_weather.xml.#\",\n    },\n    DisableEventLog: false,\n    FetchContent:    false,\n}\n```\nCalling `Connect(ctx)` will return an error if no subtopics are provided. The\nfunction will block until the initial connection with the remote server is\nestablished. When the client is provisioned, an internal Goroutine is created to\nconsume the feed.\n```go\n// create context for closing client\nctx := context.Background()\nctx, cancel := context.WithCancel(ctx)\n\nerr := client.Connect(ctx)\nif err != nil {\n    panic(err)\n}\n```\nTo consume the events, call `Consume()` on the client. This returns an `Event`\nand an indicator if the client is still actively consuming from the remote\nserver.\n```go\nfor {\n    event, closed := client.Consume()\n    if closed {\n        // not actively consuming\n        return\n    }\n    log.Println(event)\n}\n```\nTo close the client, call the cancel function on the context provided to the\nclient. This will gracefully close the active channels and connection to the\nremote server.\n```go\nclose()\n```\n\n\n## Examples\nA fully functioning client can be found in the example directory.\n\n\n## Acknowledgements\nI would like to thank [Sean Treadway](https://github.com/streadway/) for his Go\nRabbitMQ client [package](https://github.com/streadway/amqp). I would also like\nto thank Environment Canada and the awesome people at Shared Services Canada for\ntheir developments and \"openness\" of MetPX and\n[sarracenia](https://github.com/MetPX/sarracenia).\n\n\n## License\nCopyright (c) 2019 Tanner Ryan. All rights reserved. Use of this source code is\ngoverned by a BSD-style license that can be found in the LICENSE file.\n\nSean Treadway's Go RabbitMQ client package is under a BSD 2-clause license. Cenk\nAlti's Go exponential backoff package is under an MIT license. Once again, all\nrights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftannerryan%2Fecpush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftannerryan%2Fecpush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftannerryan%2Fecpush/lists"}