Bitfinex: Add subscription configuration and templating (#1597)

* Bitfinex: Correct comment about R0 OB

* Bitfinex: Test config updates

* Bitfinex: Add missing assets to configtest

* Bitfinex: Rename GenerateDefaultSubscriptions

* Bitfinex: Add Subscription configuration

* Subscriptions: Document panic in templates
This commit is contained in:
Gareth Kirwan
2024-10-18 00:23:15 +02:00
committed by GitHub
parent 9645b7b6e7
commit ba77c9946d
7 changed files with 269 additions and 203 deletions

View File

@@ -61,14 +61,15 @@ Example:
Assets and pairs should be output in the sequence in AssetPairs since text/template range function uses an sorted order for map keys.
Template functions may modify AssetPairs to update the subscription's pairs, e.g. Filtering out margin pairs already in spot subscription
Template functions may modify AssetPairs to update the subscription's pairs, e.g. Filtering out margin pairs already in spot subscription.
We use separators like this because it allows mono-templates to decide at runtime whether to fan out.
See exchanges/subscription/testdata/subscriptions.tmpl for an example mono-template showcasing various features
See exchanges/subscription/testdata/subscriptions.tmpl for an example mono-template showcasing various features.
Templates do not need to worry about joining around separators; Trailing separators will be stripped automatically.
Template functions should panic to handle errors. They are caught by text/template and turned into errors for use in `subscription.expandTemplate`.
## Contribution