sciensano

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICasesResponse

type APICasesResponse struct {
	TimeStamp TimeStamp `json:"DATE"`
	Province  string    `json:"PROVINCE"`
	Region    string    `json:"REGION"`
	AgeGroup  string    `json:"AGEGROUP"`
	Cases     int       `json:"CASES"`
}

APICasesResponse is a single entry in APICasesResponse

func (APICasesResponse) GetAttributeNames added in v1.8.4

func (v APICasesResponse) GetAttributeNames() []string

GetAttributeNames returns the names of the types of vaccinations

func (APICasesResponse) GetAttributeValues added in v1.8.4

func (v APICasesResponse) GetAttributeValues() (values []float64)

GetAttributeValues gets the value for each supported type of vaccination

func (APICasesResponse) GetGroupFieldValue added in v1.8.4

func (v APICasesResponse) GetGroupFieldValue(groupField int) (value string)

GetGroupFieldValue returns the value of the specified entry's field

func (APICasesResponse) GetTimestamp added in v1.8.4

func (v APICasesResponse) GetTimestamp() time.Time

GetTimestamp returns the entry's timestamp

func (APICasesResponse) GetTotalValue added in v1.8.4

func (v APICasesResponse) GetTotalValue() float64

GetTotalValue returns the entry's total number of vaccinations

type APICasesResponses added in v1.8.4

type APICasesResponses []*APICasesResponse

APICasesResponses is a slice of APICasesResponses structs

func (APICasesResponses) MarshalEasyJSON added in v1.8.4

func (v APICasesResponses) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (APICasesResponses) MarshalJSON added in v1.8.4

func (v APICasesResponses) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*APICasesResponses) UnmarshalEasyJSON added in v1.8.4

func (v *APICasesResponses) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*APICasesResponses) UnmarshalJSON added in v1.8.4

func (v *APICasesResponses) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type APIHospitalisationsResponse

type APIHospitalisationsResponse struct {
	TimeStamp   TimeStamp `json:"DATE"`
	Province    string    `json:"PROVINCE"`
	Region      string    `json:"REGION"`
	TotalIn     int       `json:"TOTAL_IN"`
	TotalInICU  int       `json:"TOTAL_IN_ICU"`
	TotalInResp int       `json:"TOTAL_IN_RESP"`
	TotalInECMO int       `json:"TOTAL_IN_ECMO"`
}

APIHospitalisationsResponse is a single entry in APIHospitalisationsResponse

func (APIHospitalisationsResponse) GetAttributeNames added in v1.8.4

func (v APIHospitalisationsResponse) GetAttributeNames() []string

GetAttributeNames returns the names of the types of vaccinations

func (APIHospitalisationsResponse) GetAttributeValues added in v1.8.4

func (v APIHospitalisationsResponse) GetAttributeValues() (values []float64)

GetAttributeValues gets the value for each supported type of vaccination

func (APIHospitalisationsResponse) GetGroupFieldValue added in v1.8.4

func (v APIHospitalisationsResponse) GetGroupFieldValue(groupField int) (value string)

GetGroupFieldValue returns the value of the specified entry's field

func (APIHospitalisationsResponse) GetTimestamp added in v1.8.4

func (v APIHospitalisationsResponse) GetTimestamp() time.Time

GetTimestamp returns the entry's timestamp

func (APIHospitalisationsResponse) GetTotalValue added in v1.8.4

func (v APIHospitalisationsResponse) GetTotalValue() float64

GetTotalValue returns the entry's total number of vaccinations

type APIMortalityResponse

type APIMortalityResponse struct {
	TimeStamp TimeStamp `json:"DATE"`
	Region    string    `json:"REGION"`
	AgeGroup  string    `json:"AGEGROUP"`
	Deaths    int       `json:"DEATHS"`
}

APIMortalityResponse is a single entry in APIMortalityResponse

func (APIMortalityResponse) GetAttributeNames added in v1.8.4

func (v APIMortalityResponse) GetAttributeNames() []string

GetAttributeNames returns the names of the types of vaccinations

func (APIMortalityResponse) GetAttributeValues added in v1.8.4

func (v APIMortalityResponse) GetAttributeValues() (values []float64)

GetAttributeValues gets the value for each supported type of vaccination

func (APIMortalityResponse) GetGroupFieldValue added in v1.8.4

func (v APIMortalityResponse) GetGroupFieldValue(groupField int) (value string)

GetGroupFieldValue returns the value of the specified entry's field

func (APIMortalityResponse) GetTimestamp added in v1.8.4

func (v APIMortalityResponse) GetTimestamp() time.Time

GetTimestamp returns the entry's timestamp

func (APIMortalityResponse) GetTotalValue added in v1.8.4

func (v APIMortalityResponse) GetTotalValue() float64

GetTotalValue returns the entry's total number of vaccinations

type APITestResultsResponse

type APITestResultsResponse struct {
	TimeStamp TimeStamp `json:"DATE"`
	Province  string    `json:"PROVINCE"`
	Region    string    `json:"REGION"`
	Total     int       `json:"TESTS_ALL"`
	Positive  int       `json:"TESTS_ALL_POS"`
}

APITestResultsResponse is a single entry in APITestResultsResponse

func (APITestResultsResponse) GetAttributeNames added in v1.8.4

func (v APITestResultsResponse) GetAttributeNames() []string

GetAttributeNames returns the names of the types of vaccinations

func (APITestResultsResponse) GetAttributeValues added in v1.8.4

func (v APITestResultsResponse) GetAttributeValues() (values []float64)

GetAttributeValues gets the value for each supported type of vaccination

func (APITestResultsResponse) GetGroupFieldValue added in v1.8.4

func (v APITestResultsResponse) GetGroupFieldValue(groupField int) (value string)

GetGroupFieldValue returns the value of the specified entry's field

func (APITestResultsResponse) GetTimestamp added in v1.8.4

func (v APITestResultsResponse) GetTimestamp() time.Time

GetTimestamp returns the entry's timestamp

func (APITestResultsResponse) GetTotalValue added in v1.8.4

func (v APITestResultsResponse) GetTotalValue() float64

GetTotalValue returns the entry's total number of vaccinations

type APIVaccinationsResponse

type APIVaccinationsResponse struct {
	TimeStamp TimeStamp `json:"DATE"`
	Region    string    `json:"REGION"`
	AgeGroup  string    `json:"AGEGROUP"`
	Gender    string    `json:"SEX"`
	Dose      string    `json:"DOSE"`
	Count     int       `json:"COUNT"`
}

APIVaccinationsResponse is a single entry in APIVaccinationResponse

func (APIVaccinationsResponse) GetAttributeNames added in v1.8.4

func (v APIVaccinationsResponse) GetAttributeNames() []string

GetAttributeNames returns the names of the types of vaccinations

func (APIVaccinationsResponse) GetAttributeValues added in v1.8.4

func (v APIVaccinationsResponse) GetAttributeValues() (values []float64)

GetAttributeValues gets the value for each supported type of vaccination

func (*APIVaccinationsResponse) GetGroupFieldValue added in v1.8.4

func (v *APIVaccinationsResponse) GetGroupFieldValue(groupField int) (value string)

GetGroupFieldValue returns the value of the specified entry's field

func (*APIVaccinationsResponse) GetTimestamp added in v1.8.4

func (v *APIVaccinationsResponse) GetTimestamp() time.Time

GetTimestamp returns the entry's timestamp

func (APIVaccinationsResponse) GetTotalValue added in v1.8.4

func (v APIVaccinationsResponse) GetTotalValue() float64

GetTotalValue returns the entry's total number of vaccinations

type APIVaccinationsResponses added in v1.8.4

type APIVaccinationsResponses []*APIVaccinationsResponse

APIVaccinationsResponses is a slice of APIVaccinationResponse structures

func (APIVaccinationsResponses) MarshalEasyJSON added in v1.8.4

func (v APIVaccinationsResponses) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (APIVaccinationsResponses) MarshalJSON added in v1.8.4

func (v APIVaccinationsResponses) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*APIVaccinationsResponses) UnmarshalEasyJSON added in v1.8.4

func (v *APIVaccinationsResponses) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*APIVaccinationsResponses) UnmarshalJSON added in v1.8.4

func (v *APIVaccinationsResponses) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Client

type Client struct {
	URL        string
	HTTPClient *http.Client
	Metrics    metrics.APIClientMetrics
}

Client calls the different Reporter APIs

func (*Client) GetCases

func (client *Client) GetCases(ctx context.Context) (results []apiclient.APIResponse, err error)

GetCases retrieves all recorded COVID-19 cases

func (*Client) GetHospitalisations

func (client *Client) GetHospitalisations(ctx context.Context) (results []apiclient.APIResponse, err error)

GetHospitalisations retrieves all recorded COVID-19 cases

func (*Client) GetMortality

func (client *Client) GetMortality(ctx context.Context) (results []apiclient.APIResponse, err error)

GetMortality retrieves all recorded COVID-19 mortality figures

func (*Client) GetTestResults

func (client *Client) GetTestResults(ctx context.Context) (results []apiclient.APIResponse, err error)

GetTestResults retrieves all COVID-19 test results.

func (*Client) GetVaccinations

func (client *Client) GetVaccinations(ctx context.Context) (results []apiclient.APIResponse, err error)

GetVaccinations retrieves all COVID-19 vaccinations.

func (*Client) Update

func (client *Client) Update(ctx context.Context) (entries map[string][]apiclient.APIResponse, err error)

Update calls all endpoints and returns this to the caller. This is used by a cache to refresh its content

type Getter

type Getter interface {
	GetTestResults(ctx context.Context) (results []apiclient.APIResponse, err error)
	GetVaccinations(ctx context.Context) (results []apiclient.APIResponse, err error)
	GetCases(ctx context.Context) (results []apiclient.APIResponse, err error)
	GetMortality(ctx context.Context) (results []apiclient.APIResponse, err error)
	GetHospitalisations(ctx context.Context) (results []apiclient.APIResponse, err error)
}

Getter interface exposes the different supported Reporter APIs

type TimeStamp

type TimeStamp struct {
	time.Time
}

TimeStamp represents a timestamp in the API responder. Needed for parsing purposes

func (*TimeStamp) UnmarshalJSON

func (ts *TimeStamp) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON unmarshalls a TimeStamp from the API responder.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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