Documentation
¶
Index ¶
Constants ¶
View Source
const ( SideTypeBuy common.SideType = "BUY" SideTypeSell common.SideType = "SELL" RequestMethodGET common.RequestMethod = "GET" RequestMethodPOST common.RequestMethod = "POST" /* http headers */ OK_ACCESS_KEY = "OK-ACCESS-KEY" OK_ACCESS_SIGN = "OK-ACCESS-SIGN" OK_ACCESS_TIMESTAMP = "OK-ACCESS-TIMESTAMP" OK_ACCESS_PASSPHRASE = "OK-ACCESS-PASSPHRASE" X_SIMULATE_TRADING = "x-simulated-trading" CONTENT_TYPE = "Content-Type" ACCEPT = "Accept" COOKIE = "Cookie" LOCALE = "locale=" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" /* i18n: internationalization */ ENGLISH = "en_US" SIMPLIFIED_CHINESE = "zh_CN" TRADITIONAL_CHINESE = "zh_HK" )
Variables ¶
View Source
var ( // UseTestnet 使用测试api UseTestnet = false // UseAWSnet 使用AWS api UseAWSnet = false // IsSimulate 是否使用模拟环境 IsSimulate = false )
View Source
var TimeOut = 10 * time.Second
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Method common.RequestMethod Url string Param map[string]interface{} BaseURL common.BaseURL // contains filtered or unexported fields }
func (*Client) Run ¶
func (r *Client) Run() (res *RestApiResult, err error)
type OkexApiResponse ¶
type OkexApiResponse struct { Code string `json:"code"` Msg string `json:"msg"` Data []map[string]interface{} `json:"data"` }
OkexApiResponse 解析结果
type RestApiResult ¶
type RestApiResult struct { Url string `json:"url"` Param string `json:"param"` Header string `json:"header"` Code int `json:"code"` Body string `json:"body"` // 原始返回信息 V5Response OkexApiResponse `json:"v5Response"` // okexV5返回的数据 ReqUsedTime time.Duration `json:"reqUsedTime"` TotalUsedTime time.Duration `json:"totalUsedTime"` }
Click to show internal directories.
Click to hide internal directories.