mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
1.1 KiB
Executable File
1.1 KiB
Executable File
Holidays
An m3o.com API. For example usage see m3o.com/holidays/api.
Endpoints:
List
List the holiday dates for a given country and year
https://m3o.com/holidays/api#List
package example
import(
"fmt"
"os"
"go.m3o.com/holidays"
)
// List the holiday dates for a given country and year
func GetHolidays() {
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
rsp, err := holidaysService.List(&holidays.ListRequest{
Year: 2022,
})
fmt.Println(rsp, err)
}
Countries
Get the list of countries that are supported by this API
https://m3o.com/holidays/api#Countries
package example
import(
"fmt"
"os"
"go.m3o.com/holidays"
)
// Get the list of countries that are supported by this API
func ListCountries() {
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{
})
fmt.Println(rsp, err)
}