Documentation
¶
Index ¶
Constants ¶
View Source
const (
CalAPI = "https://calendarific.com/api/v2/holidays?"
)
The API URL to get all the holidays
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalParameters ¶
type CalParameters struct {
ApiKey string `url:"api_key,omitempty"`
Country string `url:"country,omitempty"`
Year int32 `url:"year,omitempty"`
Day int32 `url:"day,omitempty"`
Month int32 `url:"month,omitempty"`
Location string `url:"location,omitempty"`
Type string `url:"type,omitempty"`
Language string `url:"language,omitempty"`
Uuid bool `url:"uuid,omitempty"`
}
Calendarific Parameters
func (*CalParameters) CalData ¶
func (p *CalParameters) CalData() (*CalResponse, error)
Request the data from Calendarific
type CalResponse ¶
type CalResponse struct {
Meta struct {
Code int `json:"code"`
} `json:"meta"`
Response struct {
Holidays []Holiday `json:"holidays"`
} `json:"response"`
}
Calendarific Response
type Holiday ¶
type Holiday struct {
Name string `json:"name"`
Description string `json:"description"`
Date struct {
Iso string `json:"iso"`
Datetime struct {
Year int `json:"year"`
Month int `json:"month"`
Day int `json:"day"`
} `json:"datetime"`
} `json:"date"`
GoDate time.Time `json:"-"` // This field is not in the original response, so ignore it when parsing JSON
Type []string `json:"type"`
Locations string `json:"locations"`
States interface{} `json:"states"` // sometimes its a struct, sometime its a string, so use interface
}
Click to show internal directories.
Click to hide internal directories.