Official Go library for Holiday API https://holidayapi.com
Find a file
gelleson 9c712ca63c add structs (#2)
* fix: added models
2019-06-01 13:49:30 -05:00
.gitignore Initial commit 2016-09-05 12:09:15 -05:00
holidayapi.go add structs (#2) 2019-06-01 13:49:30 -05:00
holidayapi_test.go add structs (#2) 2019-06-01 13:49:30 -05:00
LICENSE Initial commit 2016-09-05 12:09:15 -05:00
models.go add structs (#2) 2019-06-01 13:49:30 -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)
}