holidays

package
v3.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountriesRequest

type CountriesRequest struct {
}

type CountriesResponse

type CountriesResponse struct {
	Countries []Country `json:"countries"`
}

type Country

type Country struct {
	// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
	Code string `json:"code"`
	// The English name of the country
	Name string `json:"name"`
}

type Holiday

type Holiday struct {
	// the country this holiday occurs in
	CountryCode string `json:"countryCode"`
	// date of the holiday in yyyy-mm-dd format
	Date string `json:"date"`
	// the local name of the holiday
	LocalName string `json:"localName"`
	// the name of the holiday in English
	Name string `json:"name"`
	// the regions within the country that observe this holiday (if not all of them)
	Regions []string `json:"regions"`
	// the type of holiday Public, Bank, School, Authorities, Optional, Observance
	Types []string `json:"types"`
}

type HolidaysService

type HolidaysService struct {
	// contains filtered or unexported fields
}

func NewHolidaysService

func NewHolidaysService(token string) *HolidaysService

func (*HolidaysService) Countries

func (t *HolidaysService) Countries(request *CountriesRequest) (*CountriesResponse, error)

Get the list of countries that are supported by this API

func (*HolidaysService) List

func (t *HolidaysService) List(request *ListRequest) (*ListResponse, error)

List the holiday dates for a given country and year

type ListRequest

type ListRequest struct {
	// The 2 letter country code (as defined in ISO 3166-1 alpha-2)
	CountryCode string `json:"countryCode"`
	// The year to list holidays for
	Year int64 `json:"year,string"`
}

type ListResponse

type ListResponse struct {
	Holidays []Holiday `json:"holidays"`
}

Jump to

Keyboard shortcuts

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