Versions in this module Expand all Collapse all v0 v0.0.3 Mar 21, 2024 Changes in this version + const ANY + const FUTURES + const OPTION + const OP_ERROR + const OP_LOGIN + const OP_SUBSCRIBE + const OP_UNSUBSCRIBE + const SPOT + const SWAP + func GetEventByParam(param map[string]string) (evtId Event) + func GetInfoFromErrCode(data ErrData) Event + func GetInfoFromErrMsg(raw string) (channel string) + type Decorator func(ReqFunc) ReqFunc + type Msg struct + Info interface{} + Timestamp time.Time + func (this *Msg) Print() + type ProcessDetail struct + Data []*Msg + EndPoint string + RecvTime time.Time + ReqInfo string + SendTime time.Time + UsedTime time.Duration + func (p *ProcessDetail) String() string + type ReceivedDataCallback func(*Msg) error + type ReceivedDepthDataCallback func(time.Time, DepthData) error + type ReceivedMsgDataCallback func(time.Time, MsgData) error + type ReqFunc func(...interface{}) (res bool, msg *Msg, err error) + type WsClient struct + DepthDataList map[string]DepthDetail + DepthDataLock sync.RWMutex + OnErrorHook ReceivedDataCallback + WsApi *ApiInfo + WsEndPoint string + func NewWsClient(ep string) (r *WsClient, err error) + func (a *WsClient) AddBookMsgHook(fn ReceivedMsgDataCallback) error + func (a *WsClient) AddDepthHook(fn ReceivedDepthDataCallback) error + func (a *WsClient) AddErrMsgHook(fn ReceivedDataCallback) error + func (a *WsClient) AddMessageHook(fn ReceivedDataCallback) error + func (a *WsClient) AmendOrder(id string, param map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) BatchAmendOrders(id string, params []map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) BatchCancelOrders(id string, params []map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) BatchPlaceOrders(id string, params []map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) CancelOrder(id string, param map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) EnableAutoDepthMgr(b bool) error + func (a *WsClient) GetSnapshotByChannel(data DepthData) (snapshot *DepthDetail, err error) + func (a *WsClient) IsAlive() bool + func (a *WsClient) IsQuit() <-chan struct{} + func (a *WsClient) Jrpc(id, op string, params []map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) Login(apiKey, secKey, passPhrase string, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) MergeDepth(depData DepthData) (err error) + func (a *WsClient) Ping(timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) PlaceOrder(id string, param map[string]interface{}, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) PrivAccout(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PrivBalAndPos(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PrivBookAlgoOrder(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PrivBookOrder(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PrivPostion(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubChannel(evtId Event, op string, params []map[string]string, pd Period, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubEstDePrice(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubFundRate(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubIndexTickers(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubInstruemnts(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubKLine(op string, period Period, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubKLineIndex(op string, pd Period, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubLimitPrice(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubMarkPrice(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubMarkPriceCandle(op string, pd Period, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubOpenInsterest(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubOptionSummary(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubOrderBooks(op string, channel string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubStatus(op string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubTickers(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) PubTrade(op string, params []map[string]string, timeOut ...int) (res bool, msg []*Msg, err error) + func (a *WsClient) Send(ctx context.Context, op WSReqData) (err error) + func (a *WsClient) SetDailTimeout(tm time.Duration) + func (a *WsClient) Start() error + func (a *WsClient) Stop() error + func (a *WsClient) Subscribe(param map[string]string, timeOut ...int) (res bool, detail *ProcessDetail, err error) + func (a *WsClient) UnSubscribe(param map[string]string, timeOut ...int) (res bool, detail *ProcessDetail, err error)