Documentation ¶
Index ¶
- type CallbackFunc
- type OnReqBasisResponse
- type OnReqEstimatedRateResponse
- type OnReqIndexKLineResponse
- type OnReqKLineResponse
- type OnReqMarkPriceKLineResponse
- type OnReqPremiumIndexKLineResponse
- type OnReqTradeDetailResponse
- type OnSubAccountsResponse
- type OnSubBBOResponse
- type OnSubBasisResponse
- type OnSubContractInfoResponse
- type OnSubDepthResponse
- type OnSubDetailResponse
- type OnSubEstimatedRateResponse
- type OnSubFundingRateResponse
- type OnSubIndexKLineResponse
- type OnSubKLineResponse
- type OnSubLiquidationOrdersResponse
- type OnSubMarkPriceKLineResponse
- type OnSubMatchOrdersResponse
- type OnSubOrdersResponse
- type OnSubPositionsResponse
- type OnSubPremiumIndexKLineResponse
- type OnSubTradeDetailResponse
- type OnSubTriggerOrderResponse
- type WSIndexClient
- func (wsIx *WSIndexClient) Init(host string, callback closeChanCallback) *WSIndexClient
- func (wsIx *WSIndexClient) ReqBasis(contractCode string, period string, callbackFun OnReqBasisResponse, from int64, ...)
- func (wsIx *WSIndexClient) ReqEstimatedRateKLine(contractCode string, period string, callbackFun OnReqEstimatedRateResponse, ...)
- func (wsIx *WSIndexClient) ReqIndexKLine(contractCode string, period string, callbackFun OnReqIndexKLineResponse, ...)
- func (wsIx *WSIndexClient) ReqMarkPriceKLine(contractCode string, period string, callbackFun OnReqMarkPriceKLineResponse, ...)
- func (wsIx *WSIndexClient) ReqPremiumIndexKLine(contractCode string, period string, callbackFun OnReqPremiumIndexKLineResponse, ...)
- func (wsIx *WSIndexClient) SubBasis(contractCode string, period string, callbackFun OnSubBasisResponse, ...)
- func (wsIx *WSIndexClient) SubEstimatedRateKLine(contractCode string, period string, callbackFun OnSubEstimatedRateResponse, ...)
- func (wsIx *WSIndexClient) SubIndexKLine(contractCode string, period string, callbackFun OnSubIndexKLineResponse, ...)
- func (wsIx *WSIndexClient) SubMarkPriceKLine(contractCode string, period string, callbackFun OnSubMarkPriceKLineResponse, ...)
- func (wsIx *WSIndexClient) SubPremiumIndexKLine(contractCode string, period string, callbackFun OnSubPremiumIndexKLineResponse, ...)
- type WSMarketClient
- func (wsMk *WSMarketClient) Init(host string, callback closeChanCallback) *WSMarketClient
- func (wsMk *WSMarketClient) ReqKLine(contractCode string, period string, callbackFun OnReqKLineResponse, from int64, ...)
- func (wsMk *WSMarketClient) ReqTradeDetail(contractCode string, callbackFun OnReqTradeDetailResponse, id string)
- func (wsMk *WSMarketClient) SubBBO(contractCode string, callbackFun OnSubBBOResponse, id string)
- func (wsMk *WSMarketClient) SubDepth(contractCode string, fcType string, callbackFun OnSubDepthResponse, id string)
- func (wsMk *WSMarketClient) SubDetail(contractCode string, callbackFun OnSubDetailResponse, id string)
- func (wsMk *WSMarketClient) SubIncrementalDepth(contractCode string, size string, callbackFun OnSubDepthResponse, id string)
- func (wsMk *WSMarketClient) SubKLine(contractCode string, period string, callbackFun OnSubKLineResponse, id string)
- func (wsMk *WSMarketClient) SubTradeDetail(contractCode string, callbackFun OnSubTradeDetailResponse, id string)
- type WSNotifyClient
- func (wsNf *WSNotifyClient) CrossSubAcounts(contractCode string, callbackFun OnSubAccountsResponse, cid string)
- func (wsNf *WSNotifyClient) CrossSubMatchOrders(contractCode string, callbackFun OnSubMatchOrdersResponse, cid string)
- func (wsNf *WSNotifyClient) CrossSubOrders(contractCode string, callbackFun OnSubOrdersResponse, cid string)
- func (wsNf *WSNotifyClient) CrossSubPositions(contractCode string, callbackFun OnSubPositionsResponse, cid string)
- func (wsNf *WSNotifyClient) CrossSubTriggerOrder(contractCode string, callbackFun OnSubTriggerOrderResponse, cid string)
- func (wsNf *WSNotifyClient) CrossUnsubAccounts(marginAccount string, cid string)
- func (wsNf *WSNotifyClient) CrossUnsubMathOrders(contractCode string, cid string)
- func (wsNf *WSNotifyClient) CrossUnsubOrders(contractCode string, cid string)
- func (wsNf *WSNotifyClient) CrossUnsubPositions(contractCode string, cid string)
- func (wsNf *WSNotifyClient) CrossUnsubTriggerOrder(contractCode string, cid string)
- func (wsNf *WSNotifyClient) Init(accessKey string, secretKey string, host string, callback closeChanCallback) *WSNotifyClient
- func (wsNf *WSNotifyClient) IsolatdUnsubPositions(contractCode string, cid string)
- func (wsNf *WSNotifyClient) IsolatedSubAcounts(contractCode string, callbackFun OnSubAccountsResponse, cid string)
- func (wsNf *WSNotifyClient) IsolatedSubMatchOrders(contractCode string, callbackFun OnSubMatchOrdersResponse, cid string)
- func (wsNf *WSNotifyClient) IsolatedSubOrders(contractCode string, callbackFun OnSubOrdersResponse, cid string)
- func (wsNf *WSNotifyClient) IsolatedSubPositions(contractCode string, callbackFun OnSubPositionsResponse, cid string)
- func (wsNf *WSNotifyClient) IsolatedSubTriggerOrder(contractCode string, callbackFun OnSubTriggerOrderResponse, cid string)
- func (wsNf *WSNotifyClient) IsolatedUnsubAccounts(contractCode string, cid string)
- func (wsNf *WSNotifyClient) IsolatedUnsubMathOrders(contractCode string, cid string)
- func (wsNf *WSNotifyClient) IsolatedUnsubOrders(contractCode string, cid string)
- func (wsNf *WSNotifyClient) IsolatedUnsubTriggerOrder(contractCode string, cid string)
- func (wsNf *WSNotifyClient) SubContractInfo(contractCode string, callbackFun OnSubContractInfoResponse, cid string)
- func (wsNf *WSNotifyClient) SubFundingRate(contractCode string, callbackFun OnSubFundingRateResponse, cid string)
- func (wsNf *WSNotifyClient) SubLiquidationOrders(contractCode string, callbackFun OnSubLiquidationOrdersResponse, cid string)
- func (wsNf *WSNotifyClient) UnsubContractInfo(contractCode string, cid string)
- func (wsNf *WSNotifyClient) UnsubFundingRate(contractCode string, cid string)
- func (wsNf *WSNotifyClient) UnsubLiquidationOrders(contractCode string, cid string)
- type WebSocketOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackFunc ¶
type CallbackFunc struct {
// contains filtered or unexported fields
}
func (*CallbackFunc) Init ¶
func (wsOp *CallbackFunc) Init(fun interface{}, param reflect.Type) *CallbackFunc
type OnReqBasisResponse ¶
type OnReqBasisResponse func(*response.ReqBasisResponse)
type OnReqEstimatedRateResponse ¶
type OnReqEstimatedRateResponse func(*response.ReqIndexKLineResponse)
type OnReqIndexKLineResponse ¶
type OnReqIndexKLineResponse func(*response.ReqIndexKLineResponse)
type OnReqKLineResponse ¶
type OnReqKLineResponse func(*response.ReqKLineResponse)
type OnReqMarkPriceKLineResponse ¶
type OnReqMarkPriceKLineResponse func(*response.ReqIndexKLineResponse)
type OnReqPremiumIndexKLineResponse ¶
type OnReqPremiumIndexKLineResponse func(*response.ReqIndexKLineResponse)
type OnReqTradeDetailResponse ¶
type OnReqTradeDetailResponse func(*response.ReqTradeDetailResponse)
type OnSubAccountsResponse ¶
type OnSubAccountsResponse func(*response.SubAccountsResponse)
type OnSubContractInfoResponse ¶
type OnSubContractInfoResponse func(*response.SubContractInfoResponse)
type OnSubDepthResponse ¶
type OnSubDepthResponse func(*response.SubDepthResponse)
* 【通用】订阅 Market Depth 数据
type OnSubDetailResponse ¶
type OnSubDetailResponse func(*response.SubKLineResponse)
* 【通用】订阅 Market Detail 数据
type OnSubEstimatedRateResponse ¶
type OnSubEstimatedRateResponse func(*response.SubIndexKLineResponse)
* 【通用】订阅预测资金费率K线数据
type OnSubFundingRateResponse ¶
type OnSubFundingRateResponse func(*response.SubFundingRateResponse)
type OnSubIndexKLineResponse ¶
type OnSubIndexKLineResponse func(*response.SubIndexKLineResponse)
* 【通用】订阅溢价指数K线数据
type OnSubLiquidationOrdersResponse ¶
type OnSubLiquidationOrdersResponse func(*response.SubLiquidationOrdersResponse)
type OnSubMarkPriceKLineResponse ¶
type OnSubMarkPriceKLineResponse func(*response.SubIndexKLineResponse)
* 【通用】订阅标记价格K线数据
type OnSubMatchOrdersResponse ¶
type OnSubMatchOrdersResponse func(*response.SubOrdersResponse)
type OnSubOrdersResponse ¶
type OnSubOrdersResponse func(*response.SubOrdersResponse)
type OnSubPositionsResponse ¶
type OnSubPositionsResponse func(*response.SubPositionsResponse)
type OnSubPremiumIndexKLineResponse ¶
type OnSubPremiumIndexKLineResponse func(*response.SubIndexKLineResponse)
* 【通用】订阅溢价指数K线数据
type OnSubTradeDetailResponse ¶
type OnSubTradeDetailResponse func(*response.SubTradeDetailResponse)
type OnSubTriggerOrderResponse ¶
type OnSubTriggerOrderResponse func(*response.SubTriggerOrderResponse)
type WSIndexClient ¶
type WSIndexClient struct {
WebSocketOp
}
func (*WSIndexClient) Init ¶
func (wsIx *WSIndexClient) Init(host string, callback closeChanCallback) *WSIndexClient
func (*WSIndexClient) ReqBasis ¶
func (wsIx *WSIndexClient) ReqBasis(contractCode string, period string, callbackFun OnReqBasisResponse, from int64, to int64, basisPriceType string, id string)
* 【通用】请求基差数据
func (*WSIndexClient) ReqEstimatedRateKLine ¶
func (wsIx *WSIndexClient) ReqEstimatedRateKLine(contractCode string, period string, callbackFun OnReqEstimatedRateResponse, from int64, to int64, id string)
* 【通用】请求预测资金费率K线数据
func (*WSIndexClient) ReqIndexKLine ¶
func (wsIx *WSIndexClient) ReqIndexKLine(contractCode string, period string, callbackFun OnReqIndexKLineResponse, from int64, to int64, id string)
* 【通用】请求溢价指数K线数据
func (*WSIndexClient) ReqMarkPriceKLine ¶
func (wsIx *WSIndexClient) ReqMarkPriceKLine(contractCode string, period string, callbackFun OnReqMarkPriceKLineResponse, from int64, to int64, id string)
* 【通用】请求标记价格K线数据
func (*WSIndexClient) ReqPremiumIndexKLine ¶
func (wsIx *WSIndexClient) ReqPremiumIndexKLine(contractCode string, period string, callbackFun OnReqPremiumIndexKLineResponse, from int64, to int64, id string)
* 【通用】请求溢价指数K线数据
func (*WSIndexClient) SubBasis ¶
func (wsIx *WSIndexClient) SubBasis(contractCode string, period string, callbackFun OnSubBasisResponse, basisPriceType string, id string)
func (*WSIndexClient) SubEstimatedRateKLine ¶
func (wsIx *WSIndexClient) SubEstimatedRateKLine(contractCode string, period string, callbackFun OnSubEstimatedRateResponse, id string)
func (*WSIndexClient) SubIndexKLine ¶
func (wsIx *WSIndexClient) SubIndexKLine(contractCode string, period string, callbackFun OnSubIndexKLineResponse, id string)
func (*WSIndexClient) SubMarkPriceKLine ¶
func (wsIx *WSIndexClient) SubMarkPriceKLine(contractCode string, period string, callbackFun OnSubMarkPriceKLineResponse, id string)
func (*WSIndexClient) SubPremiumIndexKLine ¶
func (wsIx *WSIndexClient) SubPremiumIndexKLine(contractCode string, period string, callbackFun OnSubPremiumIndexKLineResponse, id string)
type WSMarketClient ¶
type WSMarketClient struct {
WebSocketOp
}
func (*WSMarketClient) Init ¶
func (wsMk *WSMarketClient) Init(host string, callback closeChanCallback) *WSMarketClient
func (*WSMarketClient) ReqKLine ¶
func (wsMk *WSMarketClient) ReqKLine(contractCode string, period string, callbackFun OnReqKLineResponse, from int64, to int64, id string)
* 【通用】请求 KLine 数据
func (*WSMarketClient) ReqTradeDetail ¶
func (wsMk *WSMarketClient) ReqTradeDetail(contractCode string, callbackFun OnReqTradeDetailResponse, id string)
* 【通用】请求 Trade Detail 数据
func (*WSMarketClient) SubBBO ¶
func (wsMk *WSMarketClient) SubBBO(contractCode string, callbackFun OnSubBBOResponse, id string)
func (*WSMarketClient) SubDepth ¶
func (wsMk *WSMarketClient) SubDepth(contractCode string, fcType string, callbackFun OnSubDepthResponse, id string)
func (*WSMarketClient) SubDetail ¶
func (wsMk *WSMarketClient) SubDetail(contractCode string, callbackFun OnSubDetailResponse, id string)
func (*WSMarketClient) SubIncrementalDepth ¶
func (wsMk *WSMarketClient) SubIncrementalDepth(contractCode string, size string, callbackFun OnSubDepthResponse, id string)
* 【通用】订阅Market Depth增量数据
func (*WSMarketClient) SubKLine ¶
func (wsMk *WSMarketClient) SubKLine(contractCode string, period string, callbackFun OnSubKLineResponse, id string)
func (*WSMarketClient) SubTradeDetail ¶
func (wsMk *WSMarketClient) SubTradeDetail(contractCode string, callbackFun OnSubTradeDetailResponse, id string)
* 【通用】订阅 Trade Detail 数据
type WSNotifyClient ¶
type WSNotifyClient struct {
WebSocketOp
}
func (*WSNotifyClient) CrossSubAcounts ¶
func (wsNf *WSNotifyClient) CrossSubAcounts(contractCode string, callbackFun OnSubAccountsResponse, cid string)
* 【全仓】资产变动数据(sub)
func (*WSNotifyClient) CrossSubMatchOrders ¶
func (wsNf *WSNotifyClient) CrossSubMatchOrders(contractCode string, callbackFun OnSubMatchOrdersResponse, cid string)
* 【全仓】订阅合约订单撮合数据(sub)
func (*WSNotifyClient) CrossSubOrders ¶
func (wsNf *WSNotifyClient) CrossSubOrders(contractCode string, callbackFun OnSubOrdersResponse, cid string)
* 【全仓】订阅订单成交数据(sub)
func (*WSNotifyClient) CrossSubPositions ¶
func (wsNf *WSNotifyClient) CrossSubPositions(contractCode string, callbackFun OnSubPositionsResponse, cid string)
* 【全仓】持仓变动更新数据(sub)
func (*WSNotifyClient) CrossSubTriggerOrder ¶
func (wsNf *WSNotifyClient) CrossSubTriggerOrder(contractCode string, callbackFun OnSubTriggerOrderResponse, cid string)
* 【全仓】订阅计划委托订单更新(sub)
func (*WSNotifyClient) CrossUnsubAccounts ¶
func (wsNf *WSNotifyClient) CrossUnsubAccounts(marginAccount string, cid string)
* 【全仓】取消订阅资产变动数据(unsub)
func (*WSNotifyClient) CrossUnsubMathOrders ¶
func (wsNf *WSNotifyClient) CrossUnsubMathOrders(contractCode string, cid string)
* 【全仓】取消订阅合约订单撮合数据(unsub)
func (*WSNotifyClient) CrossUnsubOrders ¶
func (wsNf *WSNotifyClient) CrossUnsubOrders(contractCode string, cid string)
* 【全仓】取消订阅订单成交数据(unsub)
func (*WSNotifyClient) CrossUnsubPositions ¶
func (wsNf *WSNotifyClient) CrossUnsubPositions(contractCode string, cid string)
* 【全仓】取消订阅持仓变动数据(unsub)
func (*WSNotifyClient) CrossUnsubTriggerOrder ¶
func (wsNf *WSNotifyClient) CrossUnsubTriggerOrder(contractCode string, cid string)
* 【全仓】取消订阅计划委托订单更新(unsub)
func (*WSNotifyClient) Init ¶
func (wsNf *WSNotifyClient) Init(accessKey string, secretKey string, host string, callback closeChanCallback) *WSNotifyClient
func (*WSNotifyClient) IsolatdUnsubPositions ¶
func (wsNf *WSNotifyClient) IsolatdUnsubPositions(contractCode string, cid string)
* 【逐仓】取消订阅持仓变动数据(unsub)
func (*WSNotifyClient) IsolatedSubAcounts ¶
func (wsNf *WSNotifyClient) IsolatedSubAcounts(contractCode string, callbackFun OnSubAccountsResponse, cid string)
* 【逐仓】资产变动数据(sub)
func (*WSNotifyClient) IsolatedSubMatchOrders ¶
func (wsNf *WSNotifyClient) IsolatedSubMatchOrders(contractCode string, callbackFun OnSubMatchOrdersResponse, cid string)
【逐仓】订阅合约订单撮合数据(sub)
func (*WSNotifyClient) IsolatedSubOrders ¶
func (wsNf *WSNotifyClient) IsolatedSubOrders(contractCode string, callbackFun OnSubOrdersResponse, cid string)
func (*WSNotifyClient) IsolatedSubPositions ¶
func (wsNf *WSNotifyClient) IsolatedSubPositions(contractCode string, callbackFun OnSubPositionsResponse, cid string)
* 【逐仓】持仓变动更新数据(sub)
func (*WSNotifyClient) IsolatedSubTriggerOrder ¶
func (wsNf *WSNotifyClient) IsolatedSubTriggerOrder(contractCode string, callbackFun OnSubTriggerOrderResponse, cid string)
* 【逐仓】订阅计划委托订单更新(sub)
func (*WSNotifyClient) IsolatedUnsubAccounts ¶
func (wsNf *WSNotifyClient) IsolatedUnsubAccounts(contractCode string, cid string)
* 【逐仓】取消订阅资产变动数据(unsub)
func (*WSNotifyClient) IsolatedUnsubMathOrders ¶
func (wsNf *WSNotifyClient) IsolatedUnsubMathOrders(contractCode string, cid string)
* 【逐仓】取消订阅合约订单撮合数据(unsub)
func (*WSNotifyClient) IsolatedUnsubOrders ¶
func (wsNf *WSNotifyClient) IsolatedUnsubOrders(contractCode string, cid string)
* 【逐仓】取消订阅订单成交数据(unsub)
func (*WSNotifyClient) IsolatedUnsubTriggerOrder ¶
func (wsNf *WSNotifyClient) IsolatedUnsubTriggerOrder(contractCode string, cid string)
* 【逐仓】取消订阅计划委托订单更新(unsub)
func (*WSNotifyClient) SubContractInfo ¶
func (wsNf *WSNotifyClient) SubContractInfo(contractCode string, callbackFun OnSubContractInfoResponse, cid string)
* 【通用】订阅合约信息变动(免鉴权)(sub)
func (*WSNotifyClient) SubFundingRate ¶
func (wsNf *WSNotifyClient) SubFundingRate(contractCode string, callbackFun OnSubFundingRateResponse, cid string)
* 【通用】订阅资金费率推送(免鉴权)(sub)
func (*WSNotifyClient) SubLiquidationOrders ¶
func (wsNf *WSNotifyClient) SubLiquidationOrders(contractCode string, callbackFun OnSubLiquidationOrdersResponse, cid string)
* 【通用】订阅强平订单数据(免鉴权)(sub)
func (*WSNotifyClient) UnsubContractInfo ¶
func (wsNf *WSNotifyClient) UnsubContractInfo(contractCode string, cid string)
* 【通用】取消订阅合约信息变动(免鉴权)(unsub)
func (*WSNotifyClient) UnsubFundingRate ¶
func (wsNf *WSNotifyClient) UnsubFundingRate(contractCode string, cid string)
* 【通用】取消订阅资金费率(免鉴权)(unsub)
func (*WSNotifyClient) UnsubLiquidationOrders ¶
func (wsNf *WSNotifyClient) UnsubLiquidationOrders(contractCode string, cid string)
* 【通用】取消订阅强平订单(免鉴权)(unsub)
type WebSocketOp ¶
type WebSocketOp struct { SubTopicMap map[string]*CallbackFunc // 订阅历史 ReqTopicMap map[string]*CallbackFunc // 请求历史 // contains filtered or unexported fields }
func (*WebSocketOp) Close ¶
func (ws *WebSocketOp) Close()
func (*WebSocketOp) DoHand ¶
func (ws *WebSocketOp) DoHand()
func (*WebSocketOp) SendMsg ¶
func (ws *WebSocketOp) SendMsg(data []byte) bool