mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
binance: pull out getEndpointUrl
This commit is contained in:
parent
d72d57526c
commit
bae7df806f
|
@ -302,7 +302,7 @@ func (s *Stream) handleOutboundAccountPositionEvent(e *OutboundAccountPositionEv
|
||||||
s.EmitBalanceSnapshot(snapshot)
|
s.EmitBalanceSnapshot(snapshot)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stream) dial(listenKey string) (*websocket.Conn, error) {
|
func (s *Stream) getEndpointUrl(listenKey string) string {
|
||||||
var url string
|
var url string
|
||||||
if s.PublicOnly {
|
if s.PublicOnly {
|
||||||
if s.IsFutures {
|
if s.IsFutures {
|
||||||
|
@ -318,6 +318,11 @@ func (s *Stream) dial(listenKey string) (*websocket.Conn, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Stream) dial(listenKey string) (*websocket.Conn, error) {
|
||||||
|
url := s.getEndpointUrl(listenKey)
|
||||||
conn, _, err := defaultDialer.Dial(url, nil)
|
conn, _, err := defaultDialer.Dial(url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user