data

package
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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NasacortResponse

type NasacortResponse struct {
	Response struct {
		Status        string `json:"status"`
		Location      string `json:"location"`
		Today         string `json:"today"`
		Tomorrow      string `json:"tomorrow"`
		AfterTomorrow string `json:"after_tomorrow"`
		Day4          string `json:"day_4"`
		Source        string `json:"source"`
		City          string `json:"city"`
		State         string `json:"state"`
		Raw           string `json:"raw"`
	} `json:"response"`
}

NasacortResponse is the native service return format

type NasacortService

type NasacortService struct{}

NasacortService is a pollen service for Zyrtec formatted data

func (NasacortService) GetPollenReport

func (s NasacortService) GetPollenReport(ctx context.Context, zipcode string) (PollenReport, error)

GetPollenReport gets the pollen report

type PollenReport

type PollenReport struct {
	Location          string    `json:"location"`           // The location for the report
	Zipcode           string    `json:"zip"`                // The zipcode for the report
	PredominantPollen string    `json:"predominant_pollen"` // The predominant pollen in the report period
	StartDate         time.Time `json:"startdate"`          // The start time for this report
	Data              []float64 `json:"data"`               //	Pollen data indices -- one for today and each future day
	ReportingService  string    `json:"service"`            // The reporting service
	Version           string    `json:"version"`            // Service version information
}

PollenReport represents the report of pollen data

func GetPollenReport added in v1.0.4

func GetPollenReport(ctx context.Context, services []PollenService, zipcode string) PollenReport

GetPollenReport calls all services in parallel and returns the first result

type PollenService

type PollenService interface {
	// GetPollenReport gets the pollen report
	GetPollenReport(ctx context.Context, zipcode string) (PollenReport, error)
}

PollenService is the interface for all services that can fetch pollen data

type PollencomCurrentResponse added in v1.0.24

type PollencomCurrentResponse struct {
	Type         string `json:"Type"`
	ForecastDate string `json:"ForecastDate"`
	Location     struct {
		ZIP     string `json:"ZIP"`
		City    string `json:"City"`
		State   string `json:"State"`
		Periods []struct {
			Triggers []struct {
				LGID      int    `json:"LGID"`
				Name      string `json:"Name"`
				Genus     string `json:"Genus"`
				PlantType string `json:"PlantType"`
			} `json:"Triggers"`
			Period string  `json:"Period"`
			Type   string  `json:"Type"`
			Index  float64 `json:"Index"`
		} `json:"periods"`
		DisplayLocation string `json:"DisplayLocation"`
	} `json:"Location"`
}

PollencomCurrentResponse is the native service return format for the current conditions (includes predominant pollen)

type PollencomForecastResponse added in v1.0.24

type PollencomForecastResponse struct {
	Type         string `json:"Type"`
	ForecastDate string `json:"ForecastDate"`
	Location     struct {
		ZIP     string `json:"ZIP"`
		City    string `json:"City"`
		State   string `json:"State"`
		Periods []struct {
			Period string  `json:"Period"`
			Index  float64 `json:"Index"`
		} `json:"periods"`
		DisplayLocation string `json:"DisplayLocation"`
	} `json:"Location"`
}

PollencomForecastResponse is the native service return format for the extended forecast (includes pollen indices)

type PollencomService added in v1.0.24

type PollencomService struct{}

PollencomService is a pollen service for Pollen.com formatted data

func (PollencomService) GetPollenReport added in v1.0.24

func (s PollencomService) GetPollenReport(ctx context.Context, zipcode string) (PollenReport, error)

GetPollenReport gets the pollen report

Jump to

Keyboard shortcuts

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