Documentation ¶
Index ¶
Constants ¶
View Source
const ( OkAccessKey = "OK-ACCESS-KEY" OkAccessSign = "OK-ACCESS-SIGN" OkAccessTimeStamp = "OK-ACCESS-TIMESTAMP" OkAccessPassphrase = "OK-ACCESS-PASSPHRASE" XSimulatedTrading = "x-simulated-trading" ContentType = "Content-Type" Accept = "Accept" Cookie = "Cookie" Locale = "locale=" ApplicationJson = "application/json" ApplicationJsonUtf8 = "application/json; charset=UTF-8" English = "en_US" SimplifiedChinese = "zh_CN" TraditionalChinese = "zh_HK" )
Variables ¶
View Source
var ( UseTestnet = false // UseTestnet 使用测试api UseAWSnet = false // UseAWSnet 使用AWS api IsSimulate = false // IsSimulate 是否使用模拟环境 )
View Source
var TimeOut = 10 * time.Second
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Config *Config 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.