population

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 population retrieves population 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 population data

type Instant

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

Instant is the population for a point in time

type Response

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

Response is a population 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 population data from The World Bank

Jump to

Keyboard shortcuts

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