gdp

package
v0.0.0-...-c5d5a31 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package gdp retrieves gdp data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Fetch(country string, start time.Time, end time.Time) (*Response, error)
}

Fetcher outlines methods to retrieve gdp data

type Instant

type Instant struct {
	Date  time.Time `json:"date"`
	Value float64   `json:"value"`
}

Instant is the gdp for a point in time

type Provider

type Provider string

Provider indicates the source of the data

type Response

type Response struct {
	History []Instant
	econ.Provider
}

Response is a gdp response

func (*Response) Sort

func (r *Response) Sort()

Sort will organize the History in ascending order by date

type WorldBank

type WorldBank struct {
	HTTPClient *http.Client
}

WorldBank holds settings for The World Bank API

func (*WorldBank) Fetch

func (w *WorldBank) Fetch(country string, from, to time.Time) (*Response, error)

Fetch retrieves GDP data from The World Bank

Jump to

Keyboard shortcuts

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