pollen

command module
v1.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 5 Imported by: 0

README

pollen CircleCI

AWS Lambda based API service to get pollen data forecast for a given zipcode. It's designed to attempt to get pollen data from 3 sources in parallel and return the data from the service that responds first. Instrumented with AWS x-ray.

Quick start

To use this labmda handler, grab the pollen_handler.zip from the latest release and create a lambda function in your AWS account.

When creating the function on AWS ... in the Function code section be sure to upload the pollen_handler.zip, select the 'Go' runtime, and select 'pollen' as the handler name: Screenshot of lambda creation in AWS console

Testing the service

To test the service, create a simple test event for your Lambda function. The event should include the zipcode you want to get pollen data for:

{
  "zipcode": "30019"
}

You should get a nice JSON response that looks like this:

{
  "location": "DACULA, GA",
  "zip": "30019",
  "predominant_pollen": "Oak, Birch and Sycamore.",
  "startdate": "2019-04-18T13:00:33.548528198Z",
  "data": [
    10.2,
    1,
    7.9,
    10
  ],
  "service": "Nasacort",
  "version": "1.0.4.f3092bea655df439b7b3eaa3cfe9b628dec03cff"
}

What does the data mean?

Parameter Description
location The detected city/state location for the report
zip The zipcode that was passed to the Lambda function
predominant_pollen The predominant pollen currently detected in the area
startdate The date/time for the report
data An array of floats. This indicates the pollen indices by day, starting with today. In the case of the example above, today's pollen index is 10.2, tomorrow's pollen index is 1, the next day's index is 7.9, etc.
service The reporting service
version The version of the pollen Lambda service being used

How can use it outside of AWS?

Simple! Just use AWS API Gateway to setup a REST API that calls your new Lambda function.

AWS X-ray?

Yep -- the service is instrumented with AWS X-ray, so you can get an idea of runtime performance. Just navigate to X-Ray in your console to check it out.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL