This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Adding Options to API Calls
Alessandro Sanino edited this page Aug 23, 2017
·
1 revision
Let’s start by defining the Options type:
type Options struct {
ConnTimeout time.Duration
}
Where:
|
The timeout for the connection before it expires if it does not receive a response from Bittrex servers |
You can add Options
to calls by using special WithOpts functions. Let’s take GetMarketSummary
as an example:
// Instead of
summaries, err := bittrex.GetMarketSummary("BTC-ETH")
if err != nil {
// Handle error
}
// Use
summaries, err := bittrex.GetMarketSummaryWithOpts("BTC-ETH", &bittrex.Options{
// Add options, like
ConnTimeout: time.Second * 30,
})
if err != nil {
// Handle error
}
Golang Bittrex API v2.0.
This wiki has been provided to you by The Bot Guy <[email protected]>
Please check out the license (GPLv3) and respect it.