mirror of
https://github.com/holidayapi/holidayapi-go.git
synced 2025-06-21 12:36:33 +00:00
Finished up wrapper
This commit is contained in:
parent
1adc8d6f90
commit
6556bc0cb8
2 changed files with 83 additions and 21 deletions
38
README.md
38
README.md
|
@ -1,2 +1,38 @@
|
|||
# go-holidayapi
|
||||
Official Go library for Holiday API
|
||||
Official Go library for [Holiday API](https://holidayapi.com)
|
||||
|
||||
## Usage
|
||||
|
||||
```go
|
||||
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)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue