Skip to content

stormsync/collector

Repository files navigation

Docker

project-banner


Overview

The Stormsync data collector is an open-source Go project designed for collecting hail, wind, and tornado Storm Reports from the National Weather Center. The core functionality involves collecting data from designated URLs, de-duplicating entries, and forwarding valid reports to a Kafka topic for downstream consumption.

Report Type URL
Wind Report https://www.spc.noaa.gov/climo/reports/today_wind.csv
Hail Report https://www.spc.noaa.gov/climo/reports/today_hail.csv
Tornado Report https://www.spc.noaa.gov/climo/reports/today_torn.csv

Getting Started

System Requirements:

  • Go: version 1.22.x

Installation

From source

  1. Clone the repository:
$ git clone https://github.com/stormsync/collector
  1. Change to the collector directory:
$ cd collector/cmd/collect
  1. Build the app:
$ go build -o app

Usage

From source

Run using the command below:

KAFKA_ADDRESS="my.kafka.ip-or-hostname:PORT" \
KAFKA_USER="my-kafka-username" \
KAFKA_PASSWORD="my-kafka-password" \
TOPIC="kafka-topic-to-send-reports-to" \
POLLING_INTERVAL_IN_SECONDS="60" \
REDIS_ADDRESS="my-redis-ip-or-hostname:PORT" \
REDIS_USER="my-redis-user" \
REDIS_PASSWORD="my-redis-password" \
./app

If you do not use the environment variables or do not have them set in the environment you will see the following:

time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=KAFKA_ADDRESS
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=KAFKA_USER
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=KAFKA_PASSWORD
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=TOPIC
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=POLLING_INTERVAL_IN_SECONDS
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=REDIS_ADDRESS
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=REDIS_USER
time=2024-05-21T11:02:59.097-05:00 level=ERROR msg="ENV variable required" Name=REDIS_PASSWORD

Tests

Run the test suite using the command below from the root directory of the repo:

$ go test ./...

Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your local account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone ../
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to local: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


License

This project is protected under the GNU Affero General Public License v3.0


About

polls for storm data

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors