An open API service indexing awesome lists of open source software.

https://github.com/faisaltheparttimecoder/go-calendarific

GoLang API for Calendarific Holiday API
https://github.com/faisaltheparttimecoder/go-calendarific

Last synced: 15 days ago
JSON representation

GoLang API for Calendarific Holiday API

Awesome Lists containing this project

README

          

# go-calendarific

Official Go library for Calendarific Global Holiday API

# Installation

```
dep ensure -add https://github.com/calendarific/go-calendarific
```

# Usage / Example

+ Create a file called **main.go** & insert a script like below
```
package main

import (
"fmt"
"github.com/calendarific/go-calendarific"
"os"
)

func main() {

// Loading the paramater struct
cp := calendarific.CalParameters{
ApiKey: "",
Country: "US",
Year: 2019,
}

// It returns a response struct
holidays, err := cp.CalData()
if err != nil {
fmt.Println(err)
os.Exit(1)
}

fmt.Println(holidays)
}
```

Check out the [file](https://github.com/calendarific/go-calendarific/blob/master/main.go) for parameter struct and response struct.

+ Run the program for data
```
go run main.go
```