country

package
v0.0.0-...-23920af Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "0.0.4-beta"

Variables

View Source
var FilenameBlacklist = []string{
	"fs.html",
	"um.html",
	"fq.html",
}
View Source
var IncorrectNumberOfAudioTags = errors.New("Number of audio tags != 1")
View Source
var IncorrectNumberOfFieldKeyLinks = errors.New("Number of fieldkey links != 1")
View Source
var IncorrectNumberOfSelects = errors.New("Number of select elements != 1")
View Source
var NoCountryNameError = errors.New("Country Name not found in DOM")
View Source
var NoPagesForCountryError = errors.New("No pages for country")
View Source
var NoPagesForTimeError = errors.New("No pages for this country and time")
View Source
var NoSrcAttribute = errors.New("No value found for src attribute")
View Source
var NoValueErr = errors.New("No value")
View Source
var NoValueError = errors.New("No value found in DOM")
View Source
var StringIsNaErr = errors.New("String is NA")
View Source
var StringToGPSErr = errors.New("String could not be converted to GPS")
View Source
var StringToMapErr = errors.New("String could not be converted to map")
View Source
var StringToMapOfNumbersErr = errors.New("String could not be converted to map of numbers")
View Source
var StringToNumberWithUnitsErr = errors.New("String could not be converted to number with units")
View Source
var StringToPercentageErr = errors.New("String could not be converted to percentage")
View Source
var StringToPlaceAndNumberWithUnitsErr = errors.New("String could not be converted to place and number with units")

Functions

This section is empty.

Types

type Country

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

func ForFilename

func ForFilename(f string) Country

func (Country) ClearCacheAfter

func (c Country) ClearCacheAfter(t time.Time)

func (Country) JsonForDate

func (c Country) JsonForDate(t time.Time, countryHtmlRoot, countryJsonRoot string) (*orderedmap.OrderedMap, string, error)

Returns the most recent json before the specified time

func (Country) PageForDate

func (c Country) PageForDate(t time.Time) (Page, error)

Returns the most recent page before the specified time

type Page

type Page struct {
	ParsedData *orderedmap.OrderedMap
	NameKey    string
	HasData    bool
	// contains filtered or unexported fields
}

func NewPage

func NewPage(f string) (Page, error)

func (Page) CountryList

func (p Page) CountryList() ([]string, error)

Reads the country list from the select element on the page

type Selector

type Selector struct {
	FieldKey string
	Id       string
}

Jump to

Keyboard shortcuts

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