Documentation
¶
Index ¶
- Constants
- Variables
- func BuildLocations(normCases []*NormalisedCase) map[string]*Location
- func RenderCaseStats(cS CaseStatsResponse, viewType string) (string, error)
- func RenderCases(normCases []*NormalisedCase, viewType string) (string, error)
- func RenderClusters(clusters []*Cluster, viewType string) (string, error)
- func RenderGrants(gS GrantsSummary, gR GrantsRegions, viewType string) (string, error)
- func RenderLevels(levelInt int, levelString, viewType string) (string, error)
- func RenderLocations(locations map[string]*Location, viewType string) (string, error)
- func ScrapeGrants() (GrantsSummary, GrantsRegions, error)
- func ScrapeLevel() (int, string, error)
- type AgeRange
- type AlertLevel
- type CaseStatsResponse
- type Cluster
- type Grants
- type GrantsRegions
- type GrantsSummary
- type InvalidUsageError
- type Location
- type NormalisedCase
- type RawCase
- type TravelDate
- type TravelRelated
Constants ¶
View Source
const ( CSVRenderType = "csv" JSONRenderType = "json" )
View Source
const NumLevelREMatches = 2
View Source
const TimeFormat = "2/01/2006"
Variables ¶
View Source
var ValidDHBsList = []string{
"Auckland",
"Bay of Plenty",
"Canterbury",
"Capital and Coast",
"Counties Manukau",
"Hawke's Bay",
"Hutt Valley",
"Lakes",
"MidCentral",
"Nelson Marlborough",
"Northland",
"South Canterbury",
"Southern",
"Tairawhiti",
"Taranaki",
"Waikato",
"Wairarapa",
"Waitemata",
"West Coast",
"Whanganui",
}
Functions ¶
func BuildLocations ¶
func BuildLocations(normCases []*NormalisedCase) map[string]*Location
func RenderCaseStats ¶
func RenderCaseStats(cS CaseStatsResponse, viewType string) (string, error)
func RenderCases ¶
func RenderCases(normCases []*NormalisedCase, viewType string) (string, error)
func RenderGrants ¶
func RenderGrants(gS GrantsSummary, gR GrantsRegions, viewType string) (string, error)
func RenderLocations ¶
func ScrapeGrants ¶
func ScrapeGrants() (GrantsSummary, GrantsRegions, error)
func ScrapeLevel ¶
Types ¶
type AlertLevel ¶
type CaseStatsResponse ¶
type CaseStatsResponse struct { ConfirmedCasesTotal int ConfirmedCasesNew24h int ProbableCasesTotal int ProbableCasesNew24h int RecoveredCasesTotal int RecoveredCasesNew24h int //HospitalisedCasesTotal int //HospitalisedCasesNew24h int DeathCasesTotal int DeathCasesNew24h int }
func ScrapeCaseStats ¶
func ScrapeCaseStats() (CaseStatsResponse, error)
type Cluster ¶
func ScrapeClusters ¶
type Grants ¶
type Grants struct { Summary GrantsSummary Regions GrantsRegions }
type GrantsRegions ¶
type GrantsSummary ¶
type InvalidUsageError ¶
type InvalidUsageError struct {
Problem string
}
func (InvalidUsageError) Error ¶
func (e InvalidUsageError) Error() string
type NormalisedCase ¶
type NormalisedCase struct { CaseNumber int ReportedDate time.Time LocationName string Age AgeRange Gender string IsTravelRelated TravelRelated DepartureDate TravelDate ArrivalDate TravelDate LastCityBeforeNZ string FlightNumber string CaseType string }
func NormaliseCases ¶
func NormaliseCases(rawCases []*RawCase) ([]*NormalisedCase, error)
func (*NormalisedCase) FromRaw ¶
func (n *NormalisedCase) FromRaw(r *RawCase) error
type RawCase ¶
type RawCase struct { ReportedDate string Case int Location string Age string Gender string TravelRelated string LastCityBeforeNZ string FlightNumber string DepartureDate string ArrivalDate string CaseType string }
func ScrapeCases ¶
type TravelDate ¶
type TravelRelated ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.