Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoliy Fedorenko committed Jan 4, 2021
1 parent e14e9cd commit 658a030
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Isdayoff

Requests for [Isdayoff API](https://isdayoff.ru/)
Requests client for [Isdayoff API](https://isdayoff.ru/)

## Requirements

Go 1.13+
## Install

Make sure your project is using Go Modules (it will have a `go.mod` file in its
Expand All @@ -22,14 +25,36 @@ import (
Run any of the normal `go` commands (`build`/`install`/`test`). The Go
toolchain will resolve and fetch module automatically.

Alternatively, you can also explicitly `go get` the package into a project:
Alternatively, you can also explicitly `go get` the package:

```
go get -u github.com/anatoliyfedorenko/isdayoff
```

## Example

```go
package main

import (
"fmt"
"github.com/anatoliyfedorenko/isdayoff"
)

func main() {
dayOff := isdayoff.New()
countryCode := CountryCodeKazakhstan
pre := false
covid := false
day, err := dayOff.Tomorrow(Params{
CountryCode: &countryCode,
Pre: &pre,
Covid: &covid,
})

fmt.Println(day) // 0
}
```

## Note:
- TZ names should be taken from [IANA](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)

## TODO:
- Add examples
2 changes: 1 addition & 1 deletion isdayoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (c *Client) aliasRequest(alias string, params Params) (*DayType, error) {

req.URL.RawQuery = q.Encode()

req.Header.Set("User-Agent", "isdayoff-golang-lib/1.0.0 (https://github.com/anatoliyfedorenko)")
req.Header.Set("User-Agent", "isdayoff-golang-lib/1.0.2 (https://github.com/anatoliyfedorenko)")

res, err := c.httpClient.Do(req)
if err != nil {
Expand Down
File renamed without changes.

0 comments on commit 658a030

Please sign in to comment.