Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIBatchResponse ¶ added in v1.8.4
type APIBatchResponse struct { Date Timestamp `json:"date"` Manufacturer string `json:"manufacturer"` Amount int `json:"amount"` }
APIBatchResponse represents one batch of vaccines
func (APIBatchResponse) GetAttributeNames ¶ added in v1.8.4
func (b APIBatchResponse) GetAttributeNames() []string
GetAttributeNames returns the names of the types of vaccinations
func (APIBatchResponse) GetAttributeValues ¶ added in v1.8.4
func (b APIBatchResponse) GetAttributeValues() (values []float64)
GetAttributeValues gets the value for each supported type of vaccination
func (APIBatchResponse) GetGroupFieldValue ¶ added in v1.8.4
func (b APIBatchResponse) GetGroupFieldValue(groupField int) (value string)
GetGroupFieldValue returns the value of a groupable field. Not used for APIBatchResponse.
func (APIBatchResponse) GetTimestamp ¶ added in v1.8.4
func (b APIBatchResponse) GetTimestamp() time.Time
GetTimestamp returns the batch's timestamp
func (APIBatchResponse) GetTotalValue ¶ added in v1.8.4
func (b APIBatchResponse) GetTotalValue() float64
GetTotalValue returns the entry's total number of vaccines
type Client ¶
type Client struct { URL string HTTPClient *http.Client cache.Cache Metrics metrics.APIClientMetrics }
Client calls the API to retrieve vaccine batches
func (*Client) GetBatches ¶
GetBatches returns all vaccine batches
type Getter ¶
type Getter interface {
GetBatches(ctx context.Context) (batches []apiclient.APIResponse, err error)
}
Getter interface retrieves vaccine batches
type Timestamp ¶
Timestamp representation for APIBatchResponse. Needed to unmarshal the date as received from the API
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Timestamp in a APIBatchResponse