Official Go library for Holiday API https://holidayapi.com
Find a file
Alexys Lozada 5058a30bc2 Create a ResponseHoliday struct
For a better control over the returned data, a structure is created
that maps the response.
2017-08-16 14:44:54 -05:00
.gitignore Create a ResponseHoliday struct 2017-08-16 14:44:54 -05:00
holidayapi.go Create a ResponseHoliday struct 2017-08-16 14:44:54 -05:00
LICENSE Initial commit 2016-09-05 12:09:15 -05:00
model.go Create a ResponseHoliday struct 2017-08-16 14:44:54 -05:00
README.md Finished up wrapper 2016-09-07 21:46:56 -05:00

go-holidayapi

Official Go library for Holiday API

Usage

package main

import (
    "fmt"
    "github.com/joshtronic/go-holidayapi"
)

func main() {
    hapi := holidayapi.NewV1("_MY_API_KEY_")

    holidays, err := hapi.Holidays(map[string]interface{}{
        // Required
        "country": "US",
        "year":    "2016",
        // Optional
        // "month":    "7",
        // "day":      "4",
        // "previous": "true",
        // "upcoming": "true",
        // "public":   "true",
        // "pretty":   "true",
    })

    if err != nil {
        // Error handling...
    }

    fmt.Println("%#v\n", holidays)
}