Merge pull request #9 from ekomobile/http_client_option
Docs. Http client option.
This commit is contained in:
commit
70d78f7409
17
README.md
17
README.md
@ -44,7 +44,10 @@ func DaDataExample() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Credentials
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Credentials
|
||||||
|
|
||||||
`DADATA_API_KEY` and `DADATA_SECRET_KEY` environment variables are used by default to authenticate client.
|
`DADATA_API_KEY` and `DADATA_SECRET_KEY` environment variables are used by default to authenticate client.
|
||||||
|
|
||||||
@ -61,5 +64,17 @@ creds := client.Credentials{
|
|||||||
api := NewSuggestApi(client.WithCredentialProvider(&creds))
|
api := NewSuggestApi(client.WithCredentialProvider(&creds))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### HTTP client
|
||||||
|
|
||||||
|
HTTP client may be overridden with custom one:
|
||||||
|
|
||||||
|
```go
|
||||||
|
httpClient := &http.Client{}
|
||||||
|
|
||||||
|
api := NewSuggestApi(WithHttpClient(httpClient))
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
MIT see [LICENSE](LICENSE)
|
MIT see [LICENSE](LICENSE)
|
||||||
|
Loading…
Reference in New Issue
Block a user