mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
exchanges: improves GetDefaultConfig method (#1245)
* exchanges: Add function to get standard config * exchanges: add tests (cherry-pick here and above) * after pick stuff * cleanup --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -119,7 +119,7 @@ func (w *Websocket) Setup(s *WebsocketSetup) error {
|
||||
if w.features.Unsubscribe && s.Unsubscriber == nil {
|
||||
return fmt.Errorf("%s %w", w.exchangeName, errWebsocketUnsubscriberUnset)
|
||||
}
|
||||
w.connectionMonitorDelay = s.ConnectionMonitorDelay
|
||||
w.connectionMonitorDelay = s.ExchangeConfig.ConnectionMonitorDelay
|
||||
if w.connectionMonitorDelay <= 0 {
|
||||
w.connectionMonitorDelay = config.DefaultConnectionMonitorDelay
|
||||
}
|
||||
|
||||
@@ -97,16 +97,15 @@ type Websocket struct {
|
||||
|
||||
// WebsocketSetup defines variables for setting up a websocket connection
|
||||
type WebsocketSetup struct {
|
||||
ExchangeConfig *config.Exchange
|
||||
DefaultURL string
|
||||
RunningURL string
|
||||
RunningURLAuth string
|
||||
Connector func() error
|
||||
Subscriber func([]ChannelSubscription) error
|
||||
Unsubscriber func([]ChannelSubscription) error
|
||||
GenerateSubscriptions func() ([]ChannelSubscription, error)
|
||||
Features *protocol.Features
|
||||
ConnectionMonitorDelay time.Duration
|
||||
ExchangeConfig *config.Exchange
|
||||
DefaultURL string
|
||||
RunningURL string
|
||||
RunningURLAuth string
|
||||
Connector func() error
|
||||
Subscriber func([]ChannelSubscription) error
|
||||
Unsubscriber func([]ChannelSubscription) error
|
||||
GenerateSubscriptions func() ([]ChannelSubscription, error)
|
||||
Features *protocol.Features
|
||||
|
||||
// Local orderbook buffer config values
|
||||
OrderbookBufferConfig buffer.Config
|
||||
|
||||
Reference in New Issue
Block a user