mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-22 22:55:28 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Holidays/api](
|
||||
|
||||
Endpoints:
|
||||
|
||||
## List
|
||||
|
||||
List the holiday dates for a given country and year
|
||||
|
||||
|
||||
[https://m3o.com/holidays/api#List](https://m3o.com/holidays/api#List)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
func GetHolidays() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.List(&holidays.ListRequest{
|
||||
Year: 2022,
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## Countries
|
||||
|
||||
Get the list of countries that are supported by this API
|
||||
@@ -45,7 +18,7 @@ import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/holidays"
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// Get the list of countries that are supported by this API
|
||||
@@ -57,3 +30,30 @@ func ListCountries() {
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
## List
|
||||
|
||||
List the holiday dates for a given country and year
|
||||
|
||||
|
||||
[https://m3o.com/holidays/api#List](https://m3o.com/holidays/api#List)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.m3o.com/holidays"
|
||||
)
|
||||
|
||||
// List the holiday dates for a given country and year
|
||||
func GetHolidays() {
|
||||
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := holidaysService.List(&holidays.ListRequest{
|
||||
Year: 2022,
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user