ghcdieselfuelprice

package
v0.0.0-...-0751cc3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 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 DieselFuelPriceInfo

type DieselFuelPriceInfo struct {
	// contains filtered or unexported fields
}

DieselFuelPriceInfo stores the data needed to add the latest fuel price data to the MilMove database

func NewDieselFuelPriceInfo

func NewDieselFuelPriceInfo(eiaURL string, eiaKey string, eiaDataFetcherFunction eiaDataFetcherFunction, logger *zap.Logger) *DieselFuelPriceInfo

NewDieselFuelPriceInfo creates a new dieselFuelPriceInfo struct and returns a pointer to said struct

func (*DieselFuelPriceInfo) RunFetcher

func (d *DieselFuelPriceInfo) RunFetcher(appCtx appcontext.AppContext) error

RunFetcher creates the final EIA Open Data API URL, makes a call to the API, and fetches and returns the most recent diesel fuel price data

func (*DieselFuelPriceInfo) RunStorer

func (d *DieselFuelPriceInfo) RunStorer(appCtx appcontext.AppContext) error

RunStorer stores the final EIA weekly average diesel fuel price data in the ghc_diesel_fuel_price table

type EIAData

type EIAData struct {
	RequestData requestData  `json:"request"`
	ErrorData   errorData    `json:"data"`
	SeriesData  []seriesData `json:"series"`
	// contains filtered or unexported fields
}

EIAData stores all the data returned from a call to the EIA Open Data API

func FetchEIAData

func FetchEIAData(finalEIAAPIURL string) (EIAData, error)

FetchEIAData makes a call to the EIA Open Data API and returns the API response

Jump to

Keyboard shortcuts

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