-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1492 from c9s/edwin/okx/refactor-tickers
FEATURE: [okx] generate ticker request by requestgen
- Loading branch information
Showing
7 changed files
with
463 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package okexapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
) | ||
|
||
//go:generate -command GetRequest requestgen -method GET -responseType .APIResponse -responseDataField Data | ||
//go:generate -command PostRequest requestgen -method POST -responseType .APIResponse -responseDataField Data | ||
|
||
//go:generate GetRequest -url "/api/v5/market/ticker" -type GetTickerRequest -responseDataType []MarketTicker | ||
type GetTickerRequest struct { | ||
client requestgen.APIClient | ||
|
||
instId string `param:"instId,query"` | ||
} | ||
|
||
func (c *RestClient) NewGetTickerRequest() *GetTickerRequest { | ||
return &GetTickerRequest{ | ||
client: c, | ||
} | ||
} |
170 changes: 170 additions & 0 deletions
170
pkg/exchange/okex/okexapi/get_ticker_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.