sciensano

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTestResults = iota
	TypeVaccinations
	TypeCases
	TypeMortality
	TypeHospitalisations
)

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 apiclient.GroupField) (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 apiclient.GroupField) (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 apiclient.GroupField) (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 apiclient.GroupField) (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"`
	Manufacturer string    `json:"BRAND"`
	Region       string    `json:"REGION"`
	AgeGroup     string    `json:"AGEGROUP"`
	Gender       string    `json:"SEX"`
	Dose         DoseType  `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 apiclient.GroupField) (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 {
	client.Caller
	URL string
}

Client calls the different Sciensano APIs

func (Client) DataTypes added in v1.10.0

func (c Client) DataTypes() map[int]string

func (Client) Fetch added in v1.10.0

func (c Client) Fetch(ctx context.Context, dataType int) (results []apiclient.APIResponse, err error)

func (Client) GetLastUpdates added in v1.10.0

func (c Client) GetLastUpdates(ctx context.Context, dataType int) (lastModified time.Time, err error)

type DoseType added in v1.11.0

type DoseType int

DoseType is the type of vaccination: first, full, singledose, booster, etc.

const (
	TypeVaccinationPartial DoseType = iota
	TypeVaccinationFull
	TypeVaccinationSingle
	TypeVaccinationBooster
	TypeVaccinationBooster2
	TypeVaccinationBooster3
)

func (*DoseType) MarshalJSON added in v1.11.0

func (d *DoseType) MarshalJSON() (body []byte, err error)

func (*DoseType) UnmarshalJSON added in v1.11.0

func (d *DoseType) UnmarshalJSON(body []byte) (err error)

type TimeStamp

type TimeStamp struct {
	time.Time
}

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

func (TimeStamp) MarshalJSON added in v1.10.0

func (ts TimeStamp) MarshalJSON() ([]byte, error)

MarshalJSON marshalls a TimeStamp to JSON

func (*TimeStamp) UnmarshalJSON

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

UnmarshalJSON unmarshalls a TimeStamp from the API responder.

Jump to

Keyboard shortcuts

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