ghcdieselfuelprice

package
v0.0.0-...-c486877 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 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, _ *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 {
	ResponseData responseData `json:"response"`
	RequestData  requestData  `json:"request"`
	ErrorData    errorData    `json:"error"`
	// 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

type GHCAPIValidationError

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

func NewGHCAPIValidationError

func NewGHCAPIValidationError(message string) GHCAPIValidationError

NewGHCAPIValidationError returns a new GHCAPIValidationError

func (GHCAPIValidationError) Error

func (e GHCAPIValidationError) Error() string

Error is the string representation of the InternalServerError

Jump to

Keyboard shortcuts

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