mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
subscriptions: Add templating support and integrate with Binance (#1568)
* Subscriptions: Add List.AssetPairs * Subscriptions: Add Template and QualifiedChannel These fields separate the concept of what the channel is from the qualified resource name * Subscriptions: Add List.SetStates() * Subscriptions: Add List.QualifiedChannels * Subscriptions: Rename testsubs.EqualLists * Binance: Switch to ExpandTemplates * Binance: Update ConfigTest format * Subscriptions: Test Coverage improvements * Subscriptions: Reenterant List.ExpandTemplates * Subscriptions: Move templates from subscriptions to exchanges * Binance: Inline subscription template and improvements
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"text/template"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
@@ -1150,11 +1151,22 @@ func (b *Base) GetSubscriptions() (subscription.List, error) {
|
||||
return b.Websocket.GetSubscriptions(), nil
|
||||
}
|
||||
|
||||
// GetSubscriptionTemplate returns a template for a given subscription; See exchange/subscription/README.md for more information
|
||||
func (b *Base) GetSubscriptionTemplate(*subscription.Subscription) (*template.Template, error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// AuthenticateWebsocket sends an authentication message to the websocket
|
||||
func (b *Base) AuthenticateWebsocket(_ context.Context) error {
|
||||
return common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// CanUseAuthenticatedWebsocketEndpoints calls b.Websocket.CanUseAuthenticatedEndpoints
|
||||
// Used to avoid import cycles on stream.websocket
|
||||
func (b *Base) CanUseAuthenticatedWebsocketEndpoints() bool {
|
||||
return b.Websocket != nil && b.Websocket.CanUseAuthenticatedEndpoints()
|
||||
}
|
||||
|
||||
// KlineIntervalEnabled returns if requested interval is enabled on exchange
|
||||
func (b *Base) klineIntervalEnabled(in kline.Interval) bool {
|
||||
// TODO: Add in the ability to use custom klines
|
||||
|
||||
Reference in New Issue
Block a user