holidays

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIBaseURL = "https://date.nager.at/Api/v3/PublicHolidays"

Functions

func FetchHolidays

func FetchHolidays(year int, countryCode string) ([]time.Time, error)

FetchHolidays dynamically fetches holidays for a specific year and country code, and caches the result to avoid redundant API calls.

Types

type Holiday

type Holiday struct {
	Date        string `json:"date"`
	LocalName   string `json:"localName"`
	Name        string `json:"name"`
	CountryCode string `json:"countryCode"`
}

Holiday represents the structure of the response from Date.nager.at API.

Jump to

Keyboard shortcuts

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